Exemple #1
0
 /// <summary>
 /// Uploads one or more models. When any error occurs, no models are uploaded.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// 409 (Conflict): One or more of the provided models already exist.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='models'>
 /// An array of models to add.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <ModelData> > AddAsync(this IDigitalTwinModelsOperations operations, IList <object> models = default(IList <object>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.AddWithHttpMessagesAsync(models, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #2
0
 /// <summary>
 /// Retrieves model metadata and, optionally, model definitions.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </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='digitalTwinModelsListOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ModelData> > ListNextAsync(this IDigitalTwinModelsOperations operations, string nextPageLink, DigitalTwinModelsListOptions digitalTwinModelsListOptions = default(DigitalTwinModelsListOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, digitalTwinModelsListOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #3
0
 /// <summary>
 /// Retrieves model metadata and optionally the model definition.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no model with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for the model. The id is globally unique and case sensitive.
 /// </param>
 /// <param name='includeModelDefinition'>
 /// When true the model definition will be returned as part of the result.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ModelData> GetByIdAsync(this IDigitalTwinModelsOperations operations, string id, bool?includeModelDefinition = false, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetByIdWithHttpMessagesAsync(id, includeModelDefinition, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #4
0
 /// <summary>
 /// Retrieves model metadata and, optionally, model definitions.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dependenciesFor'>
 /// The set of the models which will have their dependencies retrieved. If
 /// omitted, all models are retrieved.
 /// </param>
 /// <param name='includeModelDefinition'>
 /// When true the model definition will be returned as part of the result.
 /// </param>
 /// <param name='digitalTwinModelsListOptions'>
 /// Additional parameters for the operation
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ModelData> > ListAsync(this IDigitalTwinModelsOperations operations, IList <string> dependenciesFor = default(IList <string>), bool?includeModelDefinition = false, DigitalTwinModelsListOptions digitalTwinModelsListOptions = default(DigitalTwinModelsListOptions), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(dependenciesFor, includeModelDefinition, digitalTwinModelsListOptions, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #5
0
 /// <summary>
 /// Retrieves model metadata and, optionally, model definitions.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='dependenciesFor'>
 /// The set of the models which will have their dependencies retrieved. If
 /// omitted, all models are retrieved.
 /// </param>
 /// <param name='includeModelDefinition'>
 /// When true the model definition will be returned as part of the result.
 /// </param>
 /// <param name='digitalTwinModelsListOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <ModelData> List(this IDigitalTwinModelsOperations operations, IList <string> dependenciesFor = default(IList <string>), bool?includeModelDefinition = false, DigitalTwinModelsListOptions digitalTwinModelsListOptions = default(DigitalTwinModelsListOptions))
 {
     return(operations.ListAsync(dependenciesFor, includeModelDefinition, digitalTwinModelsListOptions).GetAwaiter().GetResult());
 }
Exemple #6
0
 /// <summary>
 /// Uploads one or more models. When any error occurs, no models are uploaded.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// 409 (Conflict): One or more of the provided models already exist.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='models'>
 /// An array of models to add.
 /// </param>
 public static IList <ModelData> Add(this IDigitalTwinModelsOperations operations, IList <object> models = default(IList <object>))
 {
     return(operations.AddAsync(models).GetAwaiter().GetResult());
 }
Exemple #7
0
 /// <summary>
 /// Retrieves model metadata and, optionally, model definitions.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// </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='digitalTwinModelsListOptions'>
 /// Additional parameters for the operation
 /// </param>
 public static IPage <ModelData> ListNext(this IDigitalTwinModelsOperations operations, string nextPageLink, DigitalTwinModelsListOptions digitalTwinModelsListOptions = default(DigitalTwinModelsListOptions))
 {
     return(operations.ListNextAsync(nextPageLink, digitalTwinModelsListOptions).GetAwaiter().GetResult());
 }
Exemple #8
0
 /// <summary>
 /// Deletes a model. A model can only be deleted if no other models reference
 /// it.
 /// Status codes:
 /// 204 (No Content): Success.
 /// 400 (Bad Request): The request is invalid.
 /// 404 (Not Found): There is no model with the provided id.
 /// 409 (Conflict): There are dependencies on the model that prevent it from
 /// being deleted.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for the model. The id is globally unique and case sensitive.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IDigitalTwinModelsOperations operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Exemple #9
0
 /// <summary>
 /// Deletes a model. A model can only be deleted if no other models reference
 /// it.
 /// Status codes:
 /// 204 (No Content): Success.
 /// 400 (Bad Request): The request is invalid.
 /// 404 (Not Found): There is no model with the provided id.
 /// 409 (Conflict): There are dependencies on the model that prevent it from
 /// being deleted.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for the model. The id is globally unique and case sensitive.
 /// </param>
 public static void Delete(this IDigitalTwinModelsOperations operations, string id)
 {
     operations.DeleteAsync(id).GetAwaiter().GetResult();
 }
Exemple #10
0
 /// <summary>
 /// Updates the metadata for a model.
 /// Status codes:
 /// 200 (OK): Success.
 /// 400 (Bad Request): The request is invalid.
 /// 404 (Not Found): There is no model with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for the model. The id is globally unique and case sensitive.
 /// </param>
 /// <param name='updateModel'>
 /// An update specification described by JSON Patch. Only the decommissioned
 /// property can be replaced.
 /// </param>
 public static void Update(this IDigitalTwinModelsOperations operations, string id, IList <object> updateModel)
 {
     operations.UpdateAsync(id, updateModel).GetAwaiter().GetResult();
 }
Exemple #11
0
 /// <summary>
 /// Retrieves model metadata and optionally the model definition.
 /// Status codes:
 /// 200 (OK): Success.
 /// 404 (Not Found): There is no model with the provided id.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// The id for the model. The id is globally unique and case sensitive.
 /// </param>
 /// <param name='includeModelDefinition'>
 /// When true the model definition will be returned as part of the result.
 /// </param>
 public static ModelData GetById(this IDigitalTwinModelsOperations operations, string id, bool?includeModelDefinition = false)
 {
     return(operations.GetByIdAsync(id, includeModelDefinition).GetAwaiter().GetResult());
 }