コード例 #1
0
        /// <summary>
        /// Update user status Manually set a user&#39;s status. When setting a user&#39;s status, the status will remain that value until set \&quot;online\&quot; again, which will return the status to being automatically updated based on user activity. ##### Permissions Must have &#x60;edit_other_users&#x60; permission for the team.
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId">User ID</param>
        /// <param name="body"></param>
        /// <returns>Task of ApiResponse (Status)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <Status> > UsersUserIdStatusPutAsyncWithHttpInfo(string userId, InlineObject22 body)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new ApiException(400, "Missing required parameter 'userId' when calling StatusApi->UsersUserIdStatusPut");
            }

            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling StatusApi->UsersUserIdStatusPut");
            }


            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.PutAsync <Status>("/users/{user_id}/status", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("UsersUserIdStatusPut", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
コード例 #2
0
        /// <summary>
        /// Update user status Manually set a user&#39;s status. When setting a user&#39;s status, the status will remain that value until set \&quot;online\&quot; again, which will return the status to being automatically updated based on user activity. ##### Permissions Must have &#x60;edit_other_users&#x60; permission for the team.
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId">User ID</param>
        /// <param name="body"></param>
        /// <returns>ApiResponse of Status</returns>
        public ApiResponse <Status> UsersUserIdStatusPutWithHttpInfo(string userId, InlineObject22 body)
        {
            // verify the required parameter 'userId' is set
            if (userId == null)
            {
                throw new ApiException(400, "Missing required parameter 'userId' when calling StatusApi->UsersUserIdStatusPut");
            }

            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling StatusApi->UsersUserIdStatusPut");
            }

            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.Put <Status>("/users/{user_id}/status", requestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception exception = this.ExceptionFactory("UsersUserIdStatusPut", response);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(response);
        }
コード例 #3
0
        /// <summary>
        /// Update user status Manually set a user&#39;s status. When setting a user&#39;s status, the status will remain that value until set \&quot;online\&quot; again, which will return the status to being automatically updated based on user activity. ##### Permissions Must have &#x60;edit_other_users&#x60; permission for the team.
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId">User ID</param>
        /// <param name="body"></param>
        /// <returns>Task of Status</returns>
        public async System.Threading.Tasks.Task <Status> UsersUserIdStatusPutAsync(string userId, InlineObject22 body)
        {
            ApiResponse <Status> localVarResponse = await UsersUserIdStatusPutAsyncWithHttpInfo(userId, body);

            return(localVarResponse.Data);
        }
コード例 #4
0
        /// <summary>
        /// Update user status Manually set a user&#39;s status. When setting a user&#39;s status, the status will remain that value until set \&quot;online\&quot; again, which will return the status to being automatically updated based on user activity. ##### Permissions Must have &#x60;edit_other_users&#x60; permission for the team.
        /// </summary>
        /// <exception cref="ApiException">Thrown when fails to make API call</exception>
        /// <param name="userId">User ID</param>
        /// <param name="body"></param>
        /// <returns>Status</returns>
        public Status UsersUserIdStatusPut(string userId, InlineObject22 body)
        {
            ApiResponse <Status> localVarResponse = UsersUserIdStatusPutWithHttpInfo(userId, body);

            return(localVarResponse.Data);
        }