<!--

    Copyright © 2016-2022 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<form [formGroup]="snmpDeviceProfileTransportConfigurationFormGroup" style="padding: 8px 0 16px;">
  <section fxLayout="row" fxLayoutGap="8px" fxLayout.xs="column">
    <mat-form-field fxFlex>
      <mat-label translate>device-profile.snmp.timeout-ms</mat-label>
      <input matInput formControlName="timeoutMs" type="number" min="0" required/>
      <mat-error *ngIf="snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('required')">
        {{ 'device-profile.snmp.timeout-ms-required' | translate }}
      </mat-error>
      <mat-error *ngIf="snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('pattern') ||
    snmpDeviceProfileTransportConfigurationFormGroup.get('timeoutMs').hasError('min')">
        {{ 'device-profile.snmp.timeout-ms-invalid-format' | translate }}
      </mat-error>
    </mat-form-field>
    <mat-form-field fxFlex>
      <mat-label translate>device-profile.snmp.retries</mat-label>
      <input matInput formControlName="retries" type="number" min="0" required/>
      <mat-error *ngIf="snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('required')">
        {{ 'device-profile.snmp.retries-required' | translate }}
      </mat-error>
      <mat-error *ngIf="snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('pattern') ||
    snmpDeviceProfileTransportConfigurationFormGroup.get('retries').hasError('min')">
        {{ 'device-profile.snmp.retries-invalid-format' | translate }}
      </mat-error>
    </mat-form-field>
  </section>
  <div class="tb-small" style="padding-bottom: 8px" translate>device-profile.snmp.communication-configs</div>
  <tb-snmp-device-profile-communication-config formControlName="communicationConfigs">
  </tb-snmp-device-profile-communication-config>
</form>
