Пример #1
0
        /// <summary>
        /// Adds group brand ID information to a group. Adds group brand ID information to a group.
        /// </summary>
        /// <exception cref="DocuSign.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="groupId">The ID of the group being accessed.</param>
        /// <param name="brandsRequest"> (optional)</param>
        /// <returns>Task of GroupBrands</returns>
        public async System.Threading.Tasks.Task <GroupBrands> BrandsPutGroupBrandsAsync(string accountId, string groupId, BrandsRequest brandsRequest = null)
        {
            ApiResponse <GroupBrands> localVarResponse = await BrandsPutGroupBrandsAsyncWithHttpInfo(accountId, groupId, brandsRequest);

            return(localVarResponse.Data);
        }
Пример #2
0
        /// <summary>
        /// Adds group brand ID information to a group. Adds group brand ID information to a group.
        /// </summary>
        /// <exception cref="DocuSign.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="groupId">The ID of the group being accessed.</param>
        /// <param name="brandsRequest"> (optional)</param>
        /// <returns>Task of ApiResponse (GroupBrands)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <GroupBrands> > BrandsPutGroupBrandsAsyncWithHttpInfo(string accountId, string groupId, BrandsRequest brandsRequest = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
            {
                throw new ApiException(400, "Missing required parameter 'accountId' when calling GroupBrandsApi->BrandsPutGroupBrands");
            }
            // verify the required parameter 'groupId' is set
            if (groupId == null)
            {
                throw new ApiException(400, "Missing required parameter 'groupId' when calling GroupBrandsApi->BrandsPutGroupBrands");
            }

            var    localVarPath         = "/v2/accounts/{accountId}/groups/{groupId}/brands";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new Dictionary <String, String>();
            var    localVarHeaderParams = new Dictionary <String, String>(Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
            };
            String localVarHttpContentType    = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (accountId != null)
            {
                localVarPathParams.Add("accountId", Configuration.ApiClient.ParameterToString(accountId));                    // path parameter
            }
            if (groupId != null)
            {
                localVarPathParams.Add("groupId", Configuration.ApiClient.ParameterToString(groupId));                  // path parameter
            }
            if (brandsRequest != null && brandsRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(brandsRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = brandsRequest; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                       Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                       localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("BrandsPutGroupBrands", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <GroupBrands>(localVarStatusCode,
                                                 localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                 (GroupBrands)Configuration.ApiClient.Deserialize(localVarResponse, typeof(GroupBrands))));
        }
Пример #3
0
        /// <summary>
        /// Adds group brand ID information to a group. Adds group brand ID information to a group.
        /// </summary>
        /// <exception cref="DocuSign.Core.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="accountId">The external account number (int) or account ID Guid.</param>
        /// <param name="groupId">The ID of the group being accessed.</param>
        /// <param name="brandsRequest"> (optional)</param>
        /// <returns>GroupBrands</returns>
        public GroupBrands BrandsPutGroupBrands(string accountId, string groupId, BrandsRequest brandsRequest = null)
        {
            ApiResponse <GroupBrands> localVarResponse = BrandsPutGroupBrandsWithHttpInfo(accountId, groupId, brandsRequest);

            return(localVarResponse.Data);
        }