/// <summary> /// Records user action when they accept or decline custom terms of service Records user action when they accept or decline custom terms of service. Records the action in audit table. Updates user's last accepted terms of service ID if they accepted it. __Minimum server version__: 5.4 ##### Permissions Must be logged in as the user being acted on. /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="userId">User GUID</param> /// <param name="body"></param> /// <returns>Task of ApiResponse (StatusOK)</returns> public async System.Threading.Tasks.Task <ApiResponse <StatusOK> > UsersUserIdTermsOfServicePostAsyncWithHttpInfo(string userId, InlineObject21 body) { // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException(400, "Missing required parameter 'userId' when calling TermsOfServiceApi->UsersUserIdTermsOfServicePost"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling TermsOfServiceApi->UsersUserIdTermsOfServicePost"); } var requestOptions = new RequestOptions(); string[] @contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] @accepts = new string[] { "application/json" }; foreach (var contentType in @contentTypes) { requestOptions.HeaderParameters.Add("Content-Type", contentType); } foreach (var accept in @accepts) { requestOptions.HeaderParameters.Add("Accept", accept); } if (userId != null) { requestOptions.PathParameters.Add("user_id", Sdcb.Mattermost.DotNetSdk.Client.ClientUtils.ParameterToString(userId)); // path parameter } requestOptions.Data = body; // make the HTTP request var response = await this.AsynchronousClient.PostAsync <StatusOK>("/users/{user_id}/terms_of_service", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("UsersUserIdTermsOfServicePost", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// Records user action when they accept or decline custom terms of service Records user action when they accept or decline custom terms of service. Records the action in audit table. Updates user's last accepted terms of service ID if they accepted it. __Minimum server version__: 5.4 ##### Permissions Must be logged in as the user being acted on. /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="userId">User GUID</param> /// <param name="body"></param> /// <returns>ApiResponse of StatusOK</returns> public ApiResponse <StatusOK> UsersUserIdTermsOfServicePostWithHttpInfo(string userId, InlineObject21 body) { // verify the required parameter 'userId' is set if (userId == null) { throw new ApiException(400, "Missing required parameter 'userId' when calling TermsOfServiceApi->UsersUserIdTermsOfServicePost"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling TermsOfServiceApi->UsersUserIdTermsOfServicePost"); } var requestOptions = new RequestOptions(); string[] @contentTypes = new string[] { "application/json" }; // to determine the Accept header string[] @accepts = new string[] { "application/json" }; var localVarContentType = Sdcb.Mattermost.DotNetSdk.Client.ClientUtils.SelectHeaderContentType(@contentTypes); if (localVarContentType != null) { requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = Sdcb.Mattermost.DotNetSdk.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) { requestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (userId != null) { requestOptions.PathParameters.Add("user_id", Sdcb.Mattermost.DotNetSdk.Client.ClientUtils.ParameterToString(userId)); // path parameter } requestOptions.Data = body; // make the HTTP request var response = this.Client.Post <StatusOK>("/users/{user_id}/terms_of_service", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("UsersUserIdTermsOfServicePost", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// Records user action when they accept or decline custom terms of service Records user action when they accept or decline custom terms of service. Records the action in audit table. Updates user's last accepted terms of service ID if they accepted it. __Minimum server version__: 5.4 ##### Permissions Must be logged in as the user being acted on. /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="userId">User GUID</param> /// <param name="body"></param> /// <returns>Task of StatusOK</returns> public async System.Threading.Tasks.Task <StatusOK> UsersUserIdTermsOfServicePostAsync(string userId, InlineObject21 body) { ApiResponse <StatusOK> localVarResponse = await UsersUserIdTermsOfServicePostAsyncWithHttpInfo(userId, body); return(localVarResponse.Data); }
/// <summary> /// Records user action when they accept or decline custom terms of service Records user action when they accept or decline custom terms of service. Records the action in audit table. Updates user's last accepted terms of service ID if they accepted it. __Minimum server version__: 5.4 ##### Permissions Must be logged in as the user being acted on. /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="userId">User GUID</param> /// <param name="body"></param> /// <returns>StatusOK</returns> public StatusOK UsersUserIdTermsOfServicePost(string userId, InlineObject21 body) { ApiResponse <StatusOK> localVarResponse = UsersUserIdTermsOfServicePostWithHttpInfo(userId, body); return(localVarResponse.Data); }