コード例 #1
0
 /// <summary>
 /// Deletes an Image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <OperationStatusResponse> BeginDeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #2
0
 /// <summary>
 /// Gets entity type (profile or interaction) image upload URL.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='hubName'>
 /// The name of the hub.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the GetUploadUrlForEntityType operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ImageDefinition> GetUploadUrlForEntityTypeAsync(this IImagesOperations operations, string resourceGroupName, string hubName, GetImageUploadUrlInput parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetUploadUrlForEntityTypeWithHttpMessagesAsync(resourceGroupName, hubName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #3
0
 /// <summary>
 /// Gets the list of Images in the subscription. Use nextLink property in the
 /// response to get the next page of Images. Do this till nextLink is null to
 /// fetch all the Images.
 /// </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 <Image> > ListNextAsync(this IImagesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #4
0
 /// <summary>
 /// Updates an image.
 /// </summary>
 /// <remarks>
 /// Updates an image resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// The request body.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labPlanName'>
 /// The name of the lab plan that uniquely identifies it within containing
 /// resource group. Used in resource URIs and in UI.
 /// </param>
 /// <param name='imageName'>
 /// The image name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Image> UpdateAsync(this IImagesOperations operations, ImageUpdate body, string resourceGroupName, string labPlanName, string imageName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, labPlanName, imageName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #5
0
 /// <summary>
 /// Create or update an image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Image operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Image> CreateOrUpdateAsync(this IImagesOperations operations, string resourceGroupName, string imageName, Image parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, imageName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #6
0
 /// <summary>
 /// Gets the list of images under a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <Image> > ListByResourceGroupAsync(this IImagesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #7
0
 /// <summary>
 /// Gets an image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='expand'>
 /// The expand expression to apply on the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Image> GetAsync(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, imageName, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
コード例 #8
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Hubs                  = new HubsOperations(this);
     Profiles              = new ProfilesOperations(this);
     Interactions          = new InteractionsOperations(this);
     Relationships         = new RelationshipsOperations(this);
     RelationshipLinks     = new RelationshipLinksOperations(this);
     AuthorizationPolicies = new AuthorizationPoliciesOperations(this);
     Connectors            = new ConnectorsOperations(this);
     ConnectorMappings     = new ConnectorMappingsOperations(this);
     Kpi             = new KpiOperations(this);
     WidgetTypes     = new WidgetTypesOperations(this);
     Views           = new ViewsOperations(this);
     Links           = new LinksOperations(this);
     Roles           = new RolesOperations(this);
     RoleAssignments = new RoleAssignmentsOperations(this);
     Images          = new ImagesOperations(this);
     BaseUri         = new System.Uri("https://management.azure.com");
     ApiVersion      = "2017-04-26";
     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()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     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 TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
コード例 #9
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Images   = new ImagesOperations(this);
     BaseUri  = "{Endpoint}/bing/v7.0";
     Endpoint = "https://api.cognitive.microsoft.com";
     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()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <PropertiesItem>("_type"));
     DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter <PropertiesItem>("_type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ResponseBase>("_type"));
     DeserializationSettings.Converters.Add(new  PolymorphicDeserializeJsonConverter <ResponseBase>("_type"));
     CustomInitialize();
 }
コード例 #10
0
 /// <summary>
 /// Update an image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Update Image operation.
 /// </param>
 public static Image Update(this IImagesOperations operations, string resourceGroupName, string imageName, ImageUpdate parameters)
 {
     return(operations.UpdateAsync(resourceGroupName, imageName, parameters).GetAwaiter().GetResult());
 }
コード例 #11
0
 /// <summary>
 /// Gets all images.
 /// </summary>
 /// <remarks>
 /// Gets all images from galleries attached to a lab plan.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labPlanName'>
 /// The name of the lab plan that uniquely identifies it within containing
 /// resource group. Used in resource URIs and in UI.
 /// </param>
 /// <param name='filter'>
 /// The filter to apply to the operation.
 /// </param>
 public static IPage <Image> ListByLabPlan(this IImagesOperations operations, string resourceGroupName, string labPlanName, string filter = default(string))
 {
     return(operations.ListByLabPlanAsync(resourceGroupName, labPlanName, filter).GetAwaiter().GetResult());
 }
コード例 #12
0
 /// <summary>
 /// Updates an image.
 /// </summary>
 /// <remarks>
 /// Updates an image resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// The request body.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labPlanName'>
 /// The name of the lab plan that uniquely identifies it within containing
 /// resource group. Used in resource URIs and in UI.
 /// </param>
 /// <param name='imageName'>
 /// The image name.
 /// </param>
 public static Image Update(this IImagesOperations operations, ImageUpdate body, string resourceGroupName, string labPlanName, string imageName)
 {
     return(operations.UpdateAsync(body, resourceGroupName, labPlanName, imageName).GetAwaiter().GetResult());
 }
コード例 #13
0
 /// <summary>
 /// Gets an image.
 /// </summary>
 /// <remarks>
 /// Gets an image resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labPlanName'>
 /// The name of the lab plan that uniquely identifies it within containing
 /// resource group. Used in resource URIs and in UI.
 /// </param>
 /// <param name='imageName'>
 /// The image name.
 /// </param>
 public static Image Get(this IImagesOperations operations, string resourceGroupName, string labPlanName, string imageName)
 {
     return(operations.GetAsync(resourceGroupName, labPlanName, imageName).GetAwaiter().GetResult());
 }
コード例 #14
0
 /// <summary>
 /// Gets the list of Images in the subscription. Use nextLink property in the
 /// response to get the next page of Images. Do this till nextLink is null to
 /// fetch all the Images.
 /// </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 <Image> ListNext(this IImagesOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
コード例 #15
0
 /// <summary>
 /// Gets the list of Images in the subscription. Use nextLink property in the
 /// response to get the next page of Images. Do this till nextLink is null to
 /// fetch all the Images.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <Image> List(this IImagesOperations operations)
 {
     return(operations.ListAsync().GetAwaiter().GetResult());
 }
コード例 #16
0
 /// <summary>
 /// Deletes an Image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 public static OperationStatusResponse BeginDelete(this IImagesOperations operations, string resourceGroupName, string imageName)
 {
     return(operations.BeginDeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult());
 }
コード例 #17
0
 /// <summary>
 /// Gets data image upload URL.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='hubName'>
 /// The name of the hub.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the GetUploadUrlForData operation.
 /// </param>
 public static ImageDefinition GetUploadUrlForData(this IImagesOperations operations, string resourceGroupName, string hubName, GetImageUploadUrlInput parameters)
 {
     return(operations.GetUploadUrlForDataAsync(resourceGroupName, hubName, parameters).GetAwaiter().GetResult());
 }
コード例 #18
0
 /// <summary>
 /// Gets the list of images under a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 public static IPage <Image> ListByResourceGroup(this IImagesOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
コード例 #19
0
 /// <summary>
 /// Deletes an Image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 public static void BeginDelete(this IImagesOperations operations, string resourceGroupName, string imageName)
 {
     operations.BeginDeleteAsync(resourceGroupName, imageName).GetAwaiter().GetResult();
 }
コード例 #20
0
 /// <summary>
 /// Gets an image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='expand'>
 /// The expand expression to apply on the operation.
 /// </param>
 public static Image Get(this IImagesOperations operations, string resourceGroupName, string imageName, string expand = default(string))
 {
     return(operations.GetAsync(resourceGroupName, imageName, expand).GetAwaiter().GetResult());
 }
コード例 #21
0
 /// <summary>
 /// Deletes an Image.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='imageName'>
 /// The name of the image.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IImagesOperations operations, string resourceGroupName, string imageName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, imageName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }