Example #1
0
 /// <summary>
 /// Adds social account for a user. Adds a new social account to a user&#39;s account.
 /// </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="userId">The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.</param>
 /// <param name="userSocialAccountLogins"> (optional)</param>
 /// <returns>Task of void</returns>
 public async System.Threading.Tasks.Task UserSocialLoginPutUserSocialLoginAsync(string accountId, string userId, UserSocialAccountLogins userSocialAccountLogins = null)
 {
     await UserSocialLoginPutUserSocialLoginAsyncWithHttpInfo(accountId, userId, userSocialAccountLogins);
 }
Example #2
0
        /// <summary>
        /// Adds social account for a user. Adds a new social account to a user&#39;s account.
        /// </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="userId">The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.</param>
        /// <param name="userSocialAccountLogins"> (optional)</param>
        /// <returns>Task of ApiResponse</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Object> > UserSocialLoginPutUserSocialLoginAsyncWithHttpInfo(string accountId, string userId, UserSocialAccountLogins userSocialAccountLogins = null)
        {
            // verify the required parameter 'accountId' is set
            if (accountId == null)
            {
                throw new ApiException(400, "Missing required parameter 'accountId' when calling UserSocialAccountLoginsApi->UserSocialLoginPutUserSocialLogin");
            }
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new ApiException(400, "Missing required parameter 'userId' when calling UserSocialAccountLoginsApi->UserSocialLoginPutUserSocialLogin");
            }

            var    localVarPath         = "/v2/accounts/{accountId}/users/{userId}/social";
            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 (userId != null)
            {
                localVarPathParams.Add("userId", Configuration.ApiClient.ParameterToString(userId));                 // path parameter
            }
            if (userSocialAccountLogins != null && userSocialAccountLogins.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(userSocialAccountLogins); // http body (model) parameter
            }
            else
            {
                localVarPostBody = userSocialAccountLogins; // 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("UserSocialLoginPutUserSocialLogin", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }


            return(new ApiResponse <Object>(localVarStatusCode,
                                            localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                            null));
        }
Example #3
0
 /// <summary>
 /// Adds social account for a user. Adds a new social account to a user&#39;s account.
 /// </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="userId">The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing.</param>
 /// <param name="userSocialAccountLogins"> (optional)</param>
 /// <returns></returns>
 public void UserSocialLoginPutUserSocialLogin(string accountId, string userId, UserSocialAccountLogins userSocialAccountLogins = null)
 {
     UserSocialLoginPutUserSocialLoginWithHttpInfo(accountId, userId, userSocialAccountLogins);
 }