/// <summary>
 /// Gets an integration account session.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='integrationAccountName'>
 /// The integration account name.
 /// </param>
 /// <param name='sessionName'>
 /// The integration account session name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IntegrationAccountSessionInner> GetAsync(this ISessionsOperations operations, string resourceGroupName, string integrationAccountName, string sessionName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, integrationAccountName, sessionName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #2
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Workflows                = new WorkflowsOperations(this);
     WorkflowVersions         = new WorkflowVersionsOperations(this);
     WorkflowTriggers         = new WorkflowTriggersOperations(this);
     WorkflowTriggerHistories = new WorkflowTriggerHistoriesOperations(this);
     WorkflowRuns             = new WorkflowRunsOperations(this);
     WorkflowRunActions       = new WorkflowRunActionsOperations(this);
     IntegrationAccounts      = new IntegrationAccountsOperations(this);
     Schemas        = new SchemasOperations(this);
     Maps           = new MapsOperations(this);
     Partners       = new PartnersOperations(this);
     Agreements     = new AgreementsOperations(this);
     Certificates   = new CertificatesOperations(this);
     Sessions       = new SessionsOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2016-06-01";
     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());
 }
예제 #3
0
        /// <summary>
        /// Works around an issue in the entity's swagger with error handling.
        /// </summary>
        /// <remarks>Retire this code once the swagger is updated.</remarks>
        internal static IntegrationAccountSession GetOrThrow(this ISessionsOperations operations, string resourceGroupName, string integrationAccountName, string sessionName)
        {
            var ret = operations.Get(resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, sessionName: sessionName);
            var integrationAccountSession = ret as IntegrationAccountSession;

            if (integrationAccountSession == null)
            {
                var error = ret as ErrorResponse;
                throw new CloudException(message: error.Error.Message)
                      {
                          Body = new CloudError {
                              Code = error.Error.Code, Message = error.Error.Message
                          }
                      };
            }

            return(integrationAccountSession);
        }
 /// <summary>
 /// Gets a list of integration account sessions.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='integrationAccountName'>
 /// The integration account name.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <IntegrationAccountSessionInner> > ListByIntegrationAccountsAsync(this ISessionsOperations operations, string resourceGroupName, string integrationAccountName, ODataQuery <IntegrationAccountSessionFilterInner> odataQuery = default(ODataQuery <IntegrationAccountSessionFilterInner>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByIntegrationAccountsWithHttpMessagesAsync(resourceGroupName, integrationAccountName, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets a list of integration account sessions.
 /// </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 <IntegrationAccountSessionInner> > ListByIntegrationAccountsNextAsync(this ISessionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByIntegrationAccountsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Deletes an integration account session.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='integrationAccountName'>
 /// The integration account name.
 /// </param>
 /// <param name='sessionName'>
 /// The integration account session name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this ISessionsOperations operations, string resourceGroupName, string integrationAccountName, string sessionName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, integrationAccountName, sessionName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }