Example #1
0
 /// <summary>
 /// Gets the status of a long running operation, such as create, update or
 /// delete a provisioning service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='operationId'>
 /// Operation id corresponding to long running operation. Use this to poll for
 /// the status.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service that the operation is running on.
 /// </param>
 /// <param name='asyncinfo'>
 /// Async header used to poll on the status of the operation, obtained while
 /// creating the long running operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AsyncOperationResult> GetOperationResultAsync(this IIotDpsResourceOperations operations, string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetOperationResultWithHttpMessagesAsync(operationId, resourceGroupName, provisioningServiceName, asyncinfo, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// Update an existing provisioning service's tags.
 /// </summary>
 /// <remarks>
 /// Update an existing provisioning service's tags. to update other fields use
 /// the CreateOrUpdate method
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service to create or update.
 /// </param>
 /// <param name='provisioningServiceTags'>
 /// Updated tag information to set into the provisioning service instance.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProvisioningServiceDescription> BeginUpdateAsync(this IIotDpsResourceOperations operations, string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, provisioningServiceName, provisioningServiceTags, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #3
0
 /// <summary>
 /// Get the list of valid SKUs for a provisioning service.
 /// </summary>
 /// <remarks>
 /// Gets the list of valid SKUs and tiers for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of resource group.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <IotDpsSkuDefinition> > ListValidSkusAsync(this IIotDpsResourceOperations operations, string provisioningServiceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListValidSkusWithHttpMessagesAsync(provisioningServiceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #4
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations     = new Operations(this);
     DpsCertificate = new DpsCertificateOperations(this);
     IotDpsResource = new IotDpsResourceOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2021-10-15";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
Example #5
0
 /// <summary>
 /// Delete the Provisioning Service
 /// </summary>
 /// <remarks>
 /// Deletes the Provisioning Service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service to delete.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IIotDpsResourceOperations operations, string provisioningServiceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDeleteWithHttpMessagesAsync(provisioningServiceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #6
0
 /// <summary>
 /// Delete the Provisioning Service
 /// </summary>
 /// <remarks>
 /// Deletes the Provisioning Service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service to delete.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 public static void BeginDelete(this IIotDpsResourceOperations operations, string provisioningServiceName, string resourceGroupName)
 {
     operations.BeginDeleteAsync(provisioningServiceName, resourceGroupName).GetAwaiter().GetResult();
 }
Example #7
0
 /// <summary>
 /// Get a list of all provisioning services in the given resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 public static IPage <ProvisioningServiceDescription> ListByResourceGroup(this IIotDpsResourceOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
Example #8
0
 /// <summary>
 /// Create or update the metadata of the provisioning service.
 /// </summary>
 /// <remarks>
 /// Create or update the metadata of the provisioning service. The usual
 /// pattern to modify a property is to retrieve the provisioning service
 /// metadata and security metadata, and then combine them with the modified
 /// values in a new body to update the provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service to create or update.
 /// </param>
 /// <param name='iotDpsDescription'>
 /// Description of the provisioning service to create or update.
 /// </param>
 public static ProvisioningServiceDescription CreateOrUpdate(this IIotDpsResourceOperations operations, string resourceGroupName, string provisioningServiceName, ProvisioningServiceDescription iotDpsDescription)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, provisioningServiceName, iotDpsDescription).GetAwaiter().GetResult());
 }
Example #9
0
 /// <summary>
 /// Get the security metadata for a provisioning service.
 /// </summary>
 /// <remarks>
 /// List the primary and secondary keys for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <SharedAccessSignatureAuthorizationRuleAccessRightsDescription> ListKeysNext(this IIotDpsResourceOperations operations, string nextPageLink)
 {
     return(operations.ListKeysNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #10
0
 /// <summary>
 /// Get the list of valid SKUs for a provisioning service.
 /// </summary>
 /// <remarks>
 /// Gets the list of valid SKUs and tiers for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <IotDpsSkuDefinition> ListValidSkusNext(this IIotDpsResourceOperations operations, string nextPageLink)
 {
     return(operations.ListValidSkusNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #11
0
 /// <summary>
 /// Check if a provisioning service name is available.
 /// </summary>
 /// <remarks>
 /// Check if a provisioning service name is available. This will validate if
 /// the name is syntactically valid and if the name is usable
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arguments'>
 /// Set the name parameter in the OperationInputs structure to the name of the
 /// provisioning service to check.
 /// </param>
 public static NameAvailabilityInfo CheckProvisioningServiceNameAvailability(this IIotDpsResourceOperations operations, OperationInputs arguments)
 {
     return(operations.CheckProvisioningServiceNameAvailabilityAsync(arguments).GetAwaiter().GetResult());
 }
Example #12
0
 /// <summary>
 /// Get the non-security related metadata of the provisioning service.
 /// </summary>
 /// <remarks>
 /// Get the metadata of the provisioning service without SAS keys.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of the provisioning service to retrieve.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group name.
 /// </param>
 public static ProvisioningServiceDescription Get(this IIotDpsResourceOperations operations, string provisioningServiceName, string resourceGroupName)
 {
     return(operations.GetAsync(provisioningServiceName, resourceGroupName).GetAwaiter().GetResult());
 }
Example #13
0
 /// <summary>
 /// Get the list of valid SKUs for a provisioning service.
 /// </summary>
 /// <remarks>
 /// Gets the list of valid SKUs and tiers for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of resource group.
 /// </param>
 public static IPage <IotDpsSkuDefinition> ListValidSkus(this IIotDpsResourceOperations operations, string provisioningServiceName, string resourceGroupName)
 {
     return(operations.ListValidSkusAsync(provisioningServiceName, resourceGroupName).GetAwaiter().GetResult());
 }
Example #14
0
 /// <summary>
 /// Gets the status of a long running operation, such as create, update or
 /// delete a provisioning service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='operationId'>
 /// Operation id corresponding to long running operation. Use this to poll for
 /// the status.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service that the operation is running on.
 /// </param>
 /// <param name='asyncinfo'>
 /// Async header used to poll on the status of the operation, obtained while
 /// creating the long running operation.
 /// </param>
 public static AsyncOperationResult GetOperationResult(this IIotDpsResourceOperations operations, string operationId, string resourceGroupName, string provisioningServiceName, string asyncinfo)
 {
     return(operations.GetOperationResultAsync(operationId, resourceGroupName, provisioningServiceName, asyncinfo).GetAwaiter().GetResult());
 }
Example #15
0
 /// <summary>
 /// Get a list of all provisioning services in the given resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <ProvisioningServiceDescription> ListByResourceGroupNext(this IIotDpsResourceOperations operations, string nextPageLink)
 {
     return(operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
Example #16
0
 /// <summary>
 /// Get a list of all provisioning services in the given resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProvisioningServiceDescription> > ListByResourceGroupNextAsync(this IIotDpsResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #17
0
 /// <summary>
 /// Check if a provisioning service name is available.
 /// </summary>
 /// <remarks>
 /// Check if a provisioning service name is available. This will validate if
 /// the name is syntactically valid and if the name is usable
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='arguments'>
 /// Set the name parameter in the OperationInputs structure to the name of the
 /// provisioning service to check.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <NameAvailabilityInfo> CheckProvisioningServiceNameAvailabilityAsync(this IIotDpsResourceOperations operations, OperationInputs arguments, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckProvisioningServiceNameAvailabilityWithHttpMessagesAsync(arguments, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #18
0
 /// <summary>
 /// Get the list of valid SKUs for a provisioning service.
 /// </summary>
 /// <remarks>
 /// Gets the list of valid SKUs and tiers for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <IotDpsSkuDefinition> > ListValidSkusNextAsync(this IIotDpsResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListValidSkusNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #19
0
 /// <summary>
 /// Get a shared access policy by name from a provisioning service.
 /// </summary>
 /// <remarks>
 /// List primary and secondary keys for a specific key name
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of the provisioning service.
 /// </param>
 /// <param name='keyName'>
 /// Logical key name to get key-values for.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the provisioning service.
 /// </param>
 public static SharedAccessSignatureAuthorizationRuleAccessRightsDescription ListKeysForKeyName(this IIotDpsResourceOperations operations, string provisioningServiceName, string keyName, string resourceGroupName)
 {
     return(operations.ListKeysForKeyNameAsync(provisioningServiceName, keyName, resourceGroupName).GetAwaiter().GetResult());
 }
Example #20
0
 /// <summary>
 /// Get the security metadata for a provisioning service.
 /// </summary>
 /// <remarks>
 /// List the primary and secondary keys for a provisioning service.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <SharedAccessSignatureAuthorizationRuleAccessRightsDescription> > ListKeysNextAsync(this IIotDpsResourceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListKeysNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #21
0
 /// <summary>
 /// Get a shared access policy by name from a provisioning service.
 /// </summary>
 /// <remarks>
 /// List primary and secondary keys for a specific key name
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of the provisioning service.
 /// </param>
 /// <param name='keyName'>
 /// Logical key name to get key-values for.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group that contains the provisioning service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <SharedAccessSignatureAuthorizationRuleAccessRightsDescription> ListKeysForKeyNameAsync(this IIotDpsResourceOperations operations, string provisioningServiceName, string keyName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListKeysForKeyNameWithHttpMessagesAsync(provisioningServiceName, keyName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #22
0
 /// <summary>
 /// Update an existing provisioning service's tags.
 /// </summary>
 /// <remarks>
 /// Update an existing provisioning service's tags. to update other fields use
 /// the CreateOrUpdate method
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Resource group identifier.
 /// </param>
 /// <param name='provisioningServiceName'>
 /// Name of provisioning service to create or update.
 /// </param>
 /// <param name='provisioningServiceTags'>
 /// Updated tag information to set into the provisioning service instance.
 /// </param>
 public static ProvisioningServiceDescription BeginUpdate(this IIotDpsResourceOperations operations, string resourceGroupName, string provisioningServiceName, TagsResource provisioningServiceTags)
 {
     return(operations.BeginUpdateAsync(resourceGroupName, provisioningServiceName, provisioningServiceTags).GetAwaiter().GetResult());
 }
Example #23
0
 /// <summary>
 /// Get all the provisioning services in a subscription.
 /// </summary>
 /// <remarks>
 /// List all the provisioning services for a given subscription id.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <ProvisioningServiceDescription> ListBySubscription(this IIotDpsResourceOperations operations)
 {
     return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult());
 }