/// <summary>
        /// Set the users who belong to an organisation group.    Requires the &#39;ManageOrganisationGroups&#39; permissions.
        /// </summary>
        /// <exception cref="ChronoSheetsAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="xChronosheetsAuth">The ChronoSheets Auth Token</param>
        /// <param name="request">A request object specifying which users belong to an organisation group.  Make sure to specify the OrganisationGroup Id in the request object so that ChronoSheets knows which OrganisationGroup to update. CsvUserIds is a comma separated list of User Ids, e.g. 1,2,3,4</param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of ApiResponseBoolean</returns>
        public async System.Threading.Tasks.Task <ApiResponseBoolean> OrganisationGroupUsersUpdateOrganisationGroupUsersAsync(string xChronosheetsAuth, SetOrganisationGroupUsersRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            ApiResponse <ApiResponseBoolean> localVarResponse = await OrganisationGroupUsersUpdateOrganisationGroupUsersWithHttpInfoAsync(xChronosheetsAuth, request, cancellationToken);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Set the users who belong to an organisation group.    Requires the &#39;ManageOrganisationGroups&#39; permissions.
        /// </summary>
        /// <exception cref="ChronoSheetsAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="xChronosheetsAuth">The ChronoSheets Auth Token</param>
        /// <param name="request">A request object specifying which users belong to an organisation group.  Make sure to specify the OrganisationGroup Id in the request object so that ChronoSheets knows which OrganisationGroup to update. CsvUserIds is a comma separated list of User Ids, e.g. 1,2,3,4</param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of ApiResponse (ApiResponseBoolean)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <ApiResponseBoolean> > OrganisationGroupUsersUpdateOrganisationGroupUsersWithHttpInfoAsync(string xChronosheetsAuth, SetOrganisationGroupUsersRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'xChronosheetsAuth' is set
            if (xChronosheetsAuth == null)
            {
                throw new ApiException(400, "Missing required parameter 'xChronosheetsAuth' when calling OrganisationGroupUsersApi->OrganisationGroupUsersUpdateOrganisationGroupUsers");
            }
            // verify the required parameter 'request' is set
            if (request == null)
            {
                throw new ApiException(400, "Missing required parameter 'request' when calling OrganisationGroupUsersApi->OrganisationGroupUsersUpdateOrganisationGroupUsers");
            }

            var    localVarPath         = "/OrganisationGroupUsers/UpdateOrganisationGroupUsers";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.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[] {
                "application/json",
                "text/json",
                "application/xml",
                "text/xml",
                "application/x-www-form-urlencoded",
                "multipart/form-data"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json",
                "text/json",
                "application/xml",
                "text/xml",
                "multipart/form-data"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

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

            if (xChronosheetsAuth != null)
            {
                localVarHeaderParams.Add("x-chronosheets-auth", this.Configuration.ApiClient.ParameterToString(xChronosheetsAuth));                            // header parameter
            }
            if (request != null && request.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter
            }
            else
            {
                localVarPostBody = request; // byte array
            }


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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <ApiResponseBoolean>(localVarStatusCode,
                                                        localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                                        (ApiResponseBoolean)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(ApiResponseBoolean))));
        }
        /// <summary>
        /// Set the users who belong to an organisation group.    Requires the &#39;ManageOrganisationGroups&#39; permissions.
        /// </summary>
        /// <exception cref="ChronoSheetsAPI.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="xChronosheetsAuth">The ChronoSheets Auth Token</param>
        /// <param name="request">A request object specifying which users belong to an organisation group.  Make sure to specify the OrganisationGroup Id in the request object so that ChronoSheets knows which OrganisationGroup to update. CsvUserIds is a comma separated list of User Ids, e.g. 1,2,3,4</param>
        /// <returns>ApiResponseBoolean</returns>
        public ApiResponseBoolean OrganisationGroupUsersUpdateOrganisationGroupUsers(string xChronosheetsAuth, SetOrganisationGroupUsersRequest request)
        {
            ApiResponse <ApiResponseBoolean> localVarResponse = OrganisationGroupUsersUpdateOrganisationGroupUsersWithHttpInfo(xChronosheetsAuth, request);

            return(localVarResponse.Data);
        }