/// <summary>
        /// Getting all communities This method renders communities ordered by creation date (ascending).
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="offset">The record index to start. Default value is 0. (optional)</param>
        /// <param name="limit">The max number of records to return. Default value is 30, max value is 150. (optional)</param>
        /// <returns>Task of ApiResponse (GetAllCommunitiesResponse)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <GetAllCommunitiesResponse> > GetAllCommunitiesAsyncWithHttpInfo(int?offset = default(int?), int?limit = default(int?))
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (offset != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "offset", offset))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (limit != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "limit", limit))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <GetAllCommunitiesResponse>("/communities", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllCommunities", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Updating a tag This method updates an existing tag from given attributes and renders it in case of success.  Authorization​: only users that are able to update tags.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="tagId"></param>
        /// <param name="name">Tag’s label.</param>
        /// <returns>Task of ApiResponse (Tag)</returns>
        public async System.Threading.Tasks.Task<RingCentral.EngageDigital.Client.ApiResponse<Tag>> UpdateTagAsyncWithHttpInfo (string tagId, string name)
        {
            // verify the required parameter 'tagId' is set
            if (tagId == null)
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'tagId' when calling TagsApi->UpdateTag");

            // verify the required parameter 'name' is set
            if (name == null)
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'name' when calling TagsApi->UpdateTag");


            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };
            
            foreach (var _contentType in _contentTypes)
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            
            foreach (var _accept in _accepts)
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            
            if (tagId != null)
                localVarRequestOptions.PathParameters.Add("tagId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(tagId)); // path parameter
            if (name != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "name", name))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync<Tag>("/tags/{tagId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UpdateTag", localVarResponse);
                if (_exception != null) throw _exception;
            }

            return localVarResponse;
        }
        /// <summary>
        /// Getting all tags This method renders tags ordered by name (ascending).
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="offset">The record index to start. Default value is 0. (optional)</param>
        /// <param name="limit">The max number of records to return. Default value is 30, max value is 150. (optional)</param>
        /// <returns>ApiResponse of GetAllTagsResponse</returns>
        public RingCentral.EngageDigital.Client.ApiResponse< GetAllTagsResponse > GetAllTagsWithHttpInfo (int? offset = default(int?), int? limit = default(int?))
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);

            if (offset != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "offset", offset))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (limit != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "limit", limit))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request
            var localVarResponse = this.Client.Get< GetAllTagsResponse >("/tags", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllTags", localVarResponse);
                if (_exception != null) throw _exception;
            }

            return localVarResponse;
        }
        /// <summary>
        /// Creating an attachment This method allows you to create an new attachment.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="file"> (optional)</param>
        /// <param name="_private"> (optional)</param>
        /// <returns>ApiResponse of Attachment</returns>
        public RingCentral.EngageDigital.Client.ApiResponse <Attachment> CreateAttachmentWithHttpInfo(System.IO.Stream file = default(System.IO.Stream), string _private = default(string))
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "multipart/form-data:"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (file != null)
            {
                localVarRequestOptions.FileParameters.Add("file", file);
            }
            if (_private != null)
            {
                localVarRequestOptions.FormParameters.Add("private", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(_private)); // form parameter
            }


            // make the HTTP request
            var localVarResponse = this.Client.Post <Attachment>("/attachments", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateAttachment", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Getting a community from its id This method renders a community from given id.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="communityId"></param>
        /// <returns>ApiResponse of Community</returns>
        public RingCentral.EngageDigital.Client.ApiResponse <Community> GetCommunityWithHttpInfo(string communityId)
        {
            // verify the required parameter 'communityId' is set
            if (communityId == null)
            {
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'communityId' when calling CommunitiesApi->GetCommunity");
            }

            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (communityId != null)
            {
                localVarRequestOptions.PathParameters.Add("communityId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(communityId)); // path parameter
            }
            // make the HTTP request
            var localVarResponse = this.Client.Get <Community>("/communities/{communityId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetCommunity", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Getting a community from its id This method renders a community from given id.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="communityId"></param>
        /// <returns>Task of ApiResponse (Community)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <Community> > GetCommunityAsyncWithHttpInfo(string communityId)
        {
            // verify the required parameter 'communityId' is set
            if (communityId == null)
            {
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'communityId' when calling CommunitiesApi->GetCommunity");
            }


            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (communityId != null)
            {
                localVarRequestOptions.PathParameters.Add("communityId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(communityId)); // path parameter
            }
            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <Community>("/communities/{communityId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetCommunity", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Creating an attachment This method allows you to create an new attachment.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="file"> (optional)</param>
        /// <param name="_private"> (optional)</param>
        /// <returns>Task of ApiResponse (Attachment)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <Attachment> > CreateAttachmentAsyncWithHttpInfo(System.IO.Stream file = default(System.IO.Stream), string _private = default(string))
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "multipart/form-data:"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (file != null)
            {
                localVarRequestOptions.FileParameters.Add("file", file);
            }
            if (_private != null)
            {
                localVarRequestOptions.FormParameters.Add("private", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(_private)); // form parameter
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <Attachment>("/attachments", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateAttachment", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Creating a tag This method creates a new tag. In case of success it renders the created tag, otherwise, it renders an error (422 HTTP code).
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="name">Tag name (mandatory).</param>
        /// <returns>ApiResponse of Tag</returns>
        public RingCentral.EngageDigital.Client.ApiResponse< Tag > CreateTagWithHttpInfo (string name)
        {
            // verify the required parameter 'name' is set
            if (name == null)
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'name' when calling TagsApi->CreateTag");

            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);

            if (name != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "name", name))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request
            var localVarResponse = this.Client.Post< Tag >("/tags", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("CreateTag", localVarResponse);
                if (_exception != null) throw _exception;
            }

            return localVarResponse;
        }
        /// <summary>
        /// Getting all timezones This method renders all available timezones.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of Collection&lt;Timezone&gt;</returns>
        public RingCentral.EngageDigital.Client.ApiResponse <Collection <Timezone> > GetAllTimezonesWithHttpInfo()
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }



            // make the HTTP request
            var localVarResponse = this.Client.Get <Collection <Timezone> >("/timezones", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllTimezones", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Getting all timezones This method renders all available timezones.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (Collection&lt;Timezone&gt;)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <Collection <Timezone> > > GetAllTimezonesAsyncWithHttpInfo()
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }



            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <Collection <Timezone> >("/timezones", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllTimezones", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Deleting a tag This method destroys an existing tag. It renders tag itself. It renders a 404 if id is invalid.  Authorization​: only users that are able to destroy tags.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="tagId"></param>
        /// <returns>ApiResponse of Tag</returns>
        public RingCentral.EngageDigital.Client.ApiResponse< Tag > DeleteTagWithHttpInfo (string tagId)
        {
            // verify the required parameter 'tagId' is set
            if (tagId == null)
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'tagId' when calling TagsApi->DeleteTag");

            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
            if (localVarContentType != null) localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);
            if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);

            if (tagId != null)
                localVarRequestOptions.PathParameters.Add("tagId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(tagId)); // path parameter


            // make the HTTP request
            var localVarResponse = this.Client.Delete< Tag >("/tags/{tagId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("DeleteTag", localVarResponse);
                if (_exception != null) throw _exception;
            }

            return localVarResponse;
        }
        /// <summary>
        /// Updating a channel This method updates an existing channel from given attributes and renders it in case of success.  Authorization​: only users that are able to update channels.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="channelId"></param>
        /// <param name="name">The name of the channel. (optional)</param>
        /// <param name="sourceIds">An array containing id of each source assigned to a channel (multiple). (optional)</param>
        /// <param name="softCapability">Number of tasks that can be assigned to agent by the routing before they are considered \&quot;occupied\&quot;. (optional)</param>
        /// <param name="hardCapability">M​aximum number of tasks that can be assigned to agents. (optional)</param>
        /// <param name="taskTimeoutSeconds">this field defines the time before a task expires (in seconds). (optional)</param>
        /// <returns>Task of ApiResponse (Channel)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <Channel> > UpdateChannelAsyncWithHttpInfo(string channelId, string name = default(string), Collection <string> sourceIds = default(Collection <string>), int?softCapability = default(int?), int?hardCapability = default(int?), int?taskTimeoutSeconds = default(int?))
        {
            // verify the required parameter 'channelId' is set
            if (channelId == null)
            {
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'channelId' when calling ChannelsApi->UpdateChannel");
            }


            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (channelId != null)
            {
                localVarRequestOptions.PathParameters.Add("channelId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(channelId)); // path parameter
            }
            if (name != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "name", name))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (sourceIds != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("multi", "source_ids", sourceIds))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (softCapability != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "soft_capability", softCapability))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (hardCapability != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "hard_capability", hardCapability))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (taskTimeoutSeconds != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "task_timeout_seconds", taskTimeoutSeconds))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <Channel>("/channels/{channelId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("UpdateChannel", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Changing an agent&#39;s status This method updates an agent&#39;s availability. Can be used to set either channels statuses OR custom  status. If both parameters are provided, ignores custom status.The status parameter​ **MUST** b​e either “away” or “available”.  Authorization​: only users that have the right to monitor the task view.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="agentId"></param>
        /// <param name="status">A hash of channel_id &#x3D;&gt; availability (must contain all channels). (optional)</param>
        /// <param name="customStatusId">id of presence status (optional) (optional)</param>
        /// <returns>Task of ApiResponse (AgentStatus)</returns>
        public async System.Threading.Tasks.Task <RingCentral.EngageDigital.Client.ApiResponse <AgentStatus> > ChangeAgentStatusAsyncWithHttpInfo(string agentId, string status = default(string), string customStatusId = default(string))
        {
            // verify the required parameter 'agentId' is set
            if (agentId == null)
            {
                throw new RingCentral.EngageDigital.Client.ApiException(400, "Missing required parameter 'agentId' when calling AgentStatusApi->ChangeAgentStatus");
            }


            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (agentId != null)
            {
                localVarRequestOptions.PathParameters.Add("agentId", RingCentral.EngageDigital.Client.ClientUtils.ParameterToString(agentId)); // path parameter
            }
            if (status != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "status", status))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (customStatusId != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "custom_status_id", customStatusId))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PutAsync <AgentStatus>("/status/{agentId}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ChangeAgentStatus", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
        /// <summary>
        /// Getting all identities This method renders identities ordered by creation date (descending). Only identities in sources where token’s user has “read” permission are returned.
        /// </summary>
        /// <exception cref="RingCentral.EngageDigital.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="communityId">To filter identities on given community id. (optional)</param>
        /// <param name="identityGroupId">To filter on given group id. (optional)</param>
        /// <param name="userId">To filter identities on given user id. (optional)</param>
        /// <param name="sort">To change the criteria chosen to sort the identities. The value can be “created_at” or (optional)</param>
        /// <param name="foreignId">To filter identities on given user id (optional)</param>
        /// <param name="uuid">To filter identities on given uuid (optional)</param>
        /// <param name="offset">The record index to start. Default value is 0. (optional)</param>
        /// <param name="limit">The max number of records to return. Default value is 30, max value is 150. (optional)</param>
        /// <returns>ApiResponse of GetAllIdentitiesResponse</returns>
        public RingCentral.EngageDigital.Client.ApiResponse <GetAllIdentitiesResponse> GetAllIdentitiesWithHttpInfo(string communityId = default(string), string identityGroupId = default(string), string userId = default(string), string sort = default(string), string foreignId = default(string), string uuid = default(string), int?offset = default(int?), int?limit = default(int?))
        {
            RingCentral.EngageDigital.Client.RequestOptions localVarRequestOptions = new RingCentral.EngageDigital.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = RingCentral.EngageDigital.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (communityId != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "community_id", communityId))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (identityGroupId != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "identity_group_id", identityGroupId))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (userId != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "user_id", userId))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (sort != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "sort", sort))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (foreignId != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "foreign_id", foreignId))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (uuid != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "uuid", uuid))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (offset != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "offset", offset))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (limit != null)
            {
                foreach (var _kvp in RingCentral.EngageDigital.Client.ClientUtils.ParameterToMultiMap("", "limit", limit))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request
            var localVarResponse = this.Client.Get <GetAllIdentitiesResponse>("/identities", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetAllIdentities", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }