/// <summary> /// Adds the specified IdentityProvider to the collection via POST. /// </summary> /// <param name="identityProvider">The IdentityProvider to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await.</returns> public System.Threading.Tasks.Task AddAsync(IdentityProvider identityProvider, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; if (string.IsNullOrEmpty(identityProvider.Id)) { throw new ServiceException(new Error { Code = "invalidRequest", Message = "ID is required to add a reference." }); } var requestBody = new ReferenceRequestBody { ODataId = string.Format("{0}/identityProviders/{1}", this.Client.BaseUrl, identityProvider.Id) }; return(this.SendAsync(requestBody, cancellationToken)); }
/// <summary> /// Adds the specified IdentityProvider to the collection via POST. /// </summary> /// <param name="identityProvider">The IdentityProvider to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created IdentityProvider.</returns> public System.Threading.Tasks.Task <IdentityProvider> AddAsync(IdentityProvider identityProvider, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <IdentityProvider>(identityProvider, cancellationToken)); }
/// <summary> /// Adds the specified IdentityProvider to the collection via POST. /// </summary> /// <param name="identityProvider">The IdentityProvider to add.</param> /// <returns>The created IdentityProvider.</returns> public System.Threading.Tasks.Task <IdentityProvider> AddAsync(IdentityProvider identityProvider) { return(this.AddAsync(identityProvider, CancellationToken.None)); }
/// <summary> /// Creates the specified IdentityProvider using POST. /// </summary> /// <param name="identityProviderToCreate">The IdentityProvider to create.</param> /// <returns>The created IdentityProvider.</returns> public System.Threading.Tasks.Task <IdentityProvider> CreateAsync(IdentityProvider identityProviderToCreate) { return(this.CreateAsync(identityProviderToCreate, CancellationToken.None)); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="identityProviderToInitialize">The <see cref="IdentityProvider"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(IdentityProvider identityProviderToInitialize) { }