/// <summary>
 /// Gets all the users registered on a Data Box Edge/Data Box Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='filter'>
 /// Specify $filter='Type eq &lt;type&gt;' to filter on user type property
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <User> > ListByDataBoxEdgeDeviceAsync(this IUsersOperations operations, string deviceName, string resourceGroupName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get user profile.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='name'>
 /// The name of the user profile.
 /// </param>
 /// <param name='expand'>
 /// Specify the $expand query. Example: 'properties($select=identity)'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UserInner> GetAsync(this IUsersOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get profile of current user.
 /// </summary>
 /// <remarks>
 /// Represents an Azure Active Directory user object.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftGraphUser> GetMyProfileAsync(this IUsersOperations operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetMyProfileWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get entities from users
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='consistencyLevel'>
 /// Indicates the requested consistency level. Documentation URL:
 /// https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/
 /// </param>
 /// <param name='top'>
 /// Show only the first n items
 /// </param>
 /// <param name='skip'>
 /// Skip the first n items
 /// </param>
 /// <param name='search'>
 /// Search items by search phrases
 /// </param>
 /// <param name='filter'>
 /// Filter items by property values
 /// </param>
 /// <param name='count'>
 /// Include count of items
 /// </param>
 /// <param name='orderby'>
 /// Order items by property values
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ListUserOKResponse> ListUserAsync(this IUsersOperations operations, string consistencyLevel = default(string), int?top = default(int?), int?skip = default(int?), string search = default(string), string filter = default(string), bool?count = default(bool?), IList <string> orderby = default(IList <string>), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListUserWithHttpMessagesAsync(consistencyLevel, top, skip, search, filter, count, orderby, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Add new entity to users
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// New entity
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftGraphUser> CreateUserAsync(this IUsersOperations operations, MicrosoftGraphUser body, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateUserWithHttpMessagesAsync(body, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get entity from users by key
 /// </summary>
 /// <remarks>
 /// Represents an Azure Active Directory user object.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='userId'>
 /// key: id of user
 /// </param>
 /// <param name='consistencyLevel'>
 /// Indicates the requested consistency level. Documentation URL:
 /// https://developer.microsoft.com/en-us/office/blogs/microsoft-graph-advanced-queries-for-directory-objects-are-now-generally-available/
 /// </param>
 /// <param name='select'>
 /// Select properties to be returned
 /// </param>
 /// <param name='expand'>
 /// Expand related entities
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <MicrosoftGraphUser> GetUserAsync(this IUsersOperations operations, string userId, string consistencyLevel = default(string), IList <string> select = default(IList <string>), IList <string> expand = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetUserWithHttpMessagesAsync(userId, consistencyLevel, select, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets user information from the directory.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='upnOrObjectId'>
 /// The object ID or principal name of the user for which to get information.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UserInner> GetAsync(this IUsersOperations operations, string upnOrObjectId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(upnOrObjectId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// List users in a given lab.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labAccountName'>
 /// The name of the lab Account.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <User> > ListAsync(this IUsersOperations operations, string resourceGroupName, string labAccountName, string labName, ODataQuery <User> odataQuery = default(ODataQuery <User>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labAccountName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create or update a lab user.
 /// </summary>
 /// <remarks>
 /// Operation to create or update a lab user.
 /// </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='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='userName'>
 /// The name of the user that uniquely identifies it within containing lab.
 /// Used in resource URIs.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <User> CreateOrUpdateAsync(this IUsersOperations operations, User body, string resourceGroupName, string labName, string userName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(body, resourceGroupName, labName, userName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new user or updates an existing user's information on a Data Box
 /// Edge/Data Box Gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='name'>
 /// The user name.
 /// </param>
 /// <param name='user'>
 /// The user details.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <User> BeginCreateOrUpdateAsync(this IUsersOperations operations, string deviceName, string name, User user, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, user, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets a collection that contains the object IDs of the groups of which the
 /// user is a member.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the user for which to get group membership.
 /// </param>
 /// <param name='parameters'>
 /// User filtering parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <string> > GetMemberGroupsAsync(this IUsersOperations operations, string objectId, UserGetMemberGroupsParametersInner parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetMemberGroupsWithHttpMessagesAsync(objectId, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets a list of users for the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextLink'>
 /// Next link for the list operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <UserInner> > ListNextAsync(this IUsersOperations operations, string nextLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the ApiManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ApiManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._apiOperationPolicy = new ApiOperationPolicyOperations(this);
     this._apiOperations      = new ApiOperationsOperations(this);
     this._apiPolicy          = new ApiPolicyOperations(this);
     this._apiProducts        = new ApiProductsOperations(this);
     this._apis = new ApisOperations(this);
     this._authorizationServers = new AuthorizationServersOperations(this);
     this._certificates         = new CertificatesOperations(this);
     this._groups               = new GroupsOperations(this);
     this._groupUsers           = new GroupUsersOperations(this);
     this._policySnippents      = new PolicySnippetsOperations(this);
     this._productApis          = new ProductApisOperations(this);
     this._productGroups        = new ProductGroupsOperations(this);
     this._productPolicy        = new ProductPolicyOperations(this);
     this._products             = new ProductsOperations(this);
     this._productSubscriptions = new ProductSubscriptionsOperations(this);
     this._regions              = new RegionsOperations(this);
     this._reports              = new ReportsOperations(this);
     this._resourceProvider     = new ResourceProviderOperations(this);
     this._subscriptions        = new SubscriptionsOperations(this);
     this._tenantPolicy         = new TenantPolicyOperations(this);
     this._userApplications     = new UserApplicationsOperations(this);
     this._userGroups           = new UserGroupsOperations(this);
     this._userIdentities       = new UserIdentitiesOperations(this);
     this._users      = new UsersOperations(this);
     this._apiVersion = "2014-02-14";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Пример #14
0
 public CancelOrderCommand(string name, IUsersOperations userOperations, IOrdersContainer ordersContainer, Menu clientMenu)
 {
     Name             = name;
     _ordersContainer = ordersContainer;
     _clientMenu      = clientMenu;
     _userOperations  = userOperations;
 }
 /// <summary>
 /// Gets list of users for the current tenant.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <UserInner> > ListAsync(this IUsersOperations operations, ODataQuery <UserInner> odataQuery = default(ODataQuery <UserInner>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create a new user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='parameters'>
 /// Parameters to create a user.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UserInner> CreateAsync(this IUsersOperations operations, UserCreateParametersInner parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Modify properties of user profiles.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='name'>
 /// The name of the user profile.
 /// </param>
 /// <param name='user'>
 /// Profile of a lab user.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <UserInner> UpdateAsync(this IUsersOperations operations, string resourceGroupName, string labName, string name, UserFragmentInner user, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, name, user, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Creates a new user or updates an existing user's information on a data box
 /// edge/gateway device.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='deviceName'>
 /// The device name.
 /// </param>
 /// <param name='name'>
 /// The user name.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='encryptedPassword'>
 /// The password details.
 /// </param>
 /// <param name='shareAccessRights'>
 /// List of shares that the user has rights on. This field should not be
 /// specified during user creation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <User> BeginCreateOrUpdateAsync(this IUsersOperations operations, string deviceName, string name, string resourceGroupName, AsymmetricEncryptedSecret encryptedPassword = default(AsymmetricEncryptedSecret), IList <ShareAccessRight> shareAccessRights = default(IList <ShareAccessRight>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, resourceGroupName, encryptedPassword, shareAccessRights, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #19
0
 public PayServiceCommand(string name, IUsersOperations clientOperations,
                          IOrdersContainer servicesContainer, Menu clientMenu)
 {
     Name = name;
     _clientOperations  = clientOperations;
     _clientMenu        = clientMenu;
     _servicesContainer = servicesContainer;
 }
 /// <summary>
 /// List all users.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IUsersOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the Api Management service.
 /// </param>
 /// <param name='query'>
 /// Optional.
 /// </param>
 /// <returns>
 /// List Users operation response details.
 /// </returns>
 public static UserListResponse List(this IUsersOperations operations, string resourceGroupName, string serviceName, QueryParameters query)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IUsersOperations)s).ListAsync(resourceGroupName, serviceName, query);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates new user.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IUsersOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the Api Management service.
 /// </param>
 /// <param name='uid'>
 /// Required. Identifier of the user.
 /// </param>
 /// <param name='parameters'>
 /// Required. Create or update parameters.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Create(this IUsersOperations operations, string resourceGroupName, string serviceName, string uid, UserCreateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IUsersOperations)s).CreateAsync(resourceGroupName, serviceName, uid, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #22
0
 public OrderServiceCommand(string name, IServiceInfoContainer serviceInfoContainer,
                            IUsersOperations userOperations, Menu clientMenu)
 {
     _serviceInfoContainer = serviceInfoContainer;
     _userOperations       = userOperations;
     _clientMenu           = clientMenu;
     Name = name;
 }
 /// <summary>
 /// List all users.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IUsersOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. NextLink from the previous successful call to List
 /// operation.
 /// </param>
 /// <returns>
 /// List Users operation response details.
 /// </returns>
 public static UserListResponse ListNext(this IUsersOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IUsersOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Generates SSO URL.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IUsersOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The name of the Api Management service.
 /// </param>
 /// <param name='uid'>
 /// Required. Identifier of the user.
 /// </param>
 /// <returns>
 /// Generate SSO Url operations response details.
 /// </returns>
 public static GenerateSsoUrlResponse GenerateSsoUrl(this IUsersOperations operations, string resourceGroupName, string serviceName, string uid)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IUsersOperations)s).GenerateSsoUrlAsync(resourceGroupName, serviceName, uid);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #25
0
 public ServicesController(IServiceInfoContainer serviceInfoContainer,
                           IUsersContainer usersContainer, IUsersOperations usersOperations,
                           IServicesOperations servicesOperations, IOrdersContainer ordersContainer)
 {
     _usersOperations      = usersOperations;
     _servicesOperations   = servicesOperations;
     _ordersContainer      = ordersContainer;
     _serviceInfoContainer = serviceInfoContainer;
     _usersContainer       = usersContainer;
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Operations         = new Operations(this);
     Devices            = new DevicesOperations(this);
     Alerts             = new AlertsOperations(this);
     BandwidthSchedules = new BandwidthSchedulesOperations(this);
     Jobs                             = new JobsOperations(this);
     OperationsStatus                 = new OperationsStatus(this);
     Orders                           = new OrdersOperations(this);
     Roles                            = new RolesOperations(this);
     Shares                           = new SharesOperations(this);
     StorageAccountCredentials        = new StorageAccountCredentialsOperations(this);
     Triggers                         = new TriggersOperations(this);
     Users                            = new UsersOperations(this);
     BaseUri                          = new System.Uri("https://management.azure.com");
     ApiVersion                       = "2019-03-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()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Role>("kind"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Role>("kind"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <Trigger>("kind"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <Trigger>("kind"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ProviderOperations = new ProviderOperations(this);
     GlobalUsers        = new GlobalUsersOperations(this);
     LabAccounts        = new LabAccountsOperations(this);
     Operations         = new Operations(this);
     GalleryImages      = new GalleryImagesOperations(this);
     Labs = new LabsOperations(this);
     EnvironmentSettings = new EnvironmentSettingsOperations(this);
     Environments        = new EnvironmentsOperations(this);
     Users          = new UsersOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-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()
         }
     };
     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());
 }
 /// <summary>
 /// Initializes a new instance of the ApiManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public ApiManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._apiOperationPolicy = new ApiOperationPolicyOperations(this);
     this._apiOperations      = new ApiOperationsOperations(this);
     this._apiPolicy          = new ApiPolicyOperations(this);
     this._apiProducts        = new ApiProductsOperations(this);
     this._apis = new ApisOperations(this);
     this._authorizationServers = new AuthorizationServersOperations(this);
     this._backends             = new BackendOperations(this);
     this._certificates         = new CertificatesOperations(this);
     this._groups                       = new GroupsOperations(this);
     this._groupUsers                   = new GroupUsersOperations(this);
     this._identityProvider             = new IdentityProviderOperations(this);
     this._loggers                      = new LoggerOperations(this);
     this._openIdConnectProviders       = new OpenIdConnectProvidersOperations(this);
     this._policySnippents              = new PolicySnippetsOperations(this);
     this._productApis                  = new ProductApisOperations(this);
     this._productGroups                = new ProductGroupsOperations(this);
     this._productPolicy                = new ProductPolicyOperations(this);
     this._products                     = new ProductsOperations(this);
     this._productSubscriptions         = new ProductSubscriptionsOperations(this);
     this._property                     = new PropertiesOperations(this);
     this._regions                      = new RegionsOperations(this);
     this._reports                      = new ReportsOperations(this);
     this._resourceProvider             = new ResourceProviderOperations(this);
     this._subscriptions                = new SubscriptionsOperations(this);
     this._tenantAccessGit              = new TenantAccessGitOperations(this);
     this._tenantAccess                 = new TenantAccessInformationOperations(this);
     this._tenantConfiguration          = new TenantConfigurationOperations(this);
     this._tenantConfigurationSyncState = new TenantConfigurationSyncStateOperation(this);
     this._tenantPolicy                 = new TenantPolicyOperations(this);
     this._userApplications             = new UserApplicationsOperations(this);
     this._userGroups                   = new UserGroupsOperations(this);
     this._userIdentities               = new UserIdentitiesOperations(this);
     this._users             = new UsersOperations(this);
     this._userSubscriptions = new UserSubscriptionsOperations(this);
     this._apiVersion        = "2016-10-10";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Пример #29
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Objects           = new ObjectsOperations(this);
     Applications      = new ApplicationsOperations(this);
     Groups            = new GroupsOperations(this);
     ServicePrincipals = new ServicePrincipalsOperations(this);
     Users             = new UsersOperations(this);
     BaseUri           = new System.Uri("https://graph.windows.net");
     ApiVersion        = "1.6";
     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());
 }
 /// <summary>
 /// Delete a user.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='upnOrObjectId'>
 /// The object ID or principal name of the user to delete.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IUsersOperations operations, string upnOrObjectId, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(upnOrObjectId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }