=begin
#Tags

#Use these endpoints for interacting with Blog Posts, Blog Authors, and Blog Tags

The version of the OpenAPI document: v3

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1

=end

require 'cgi'

module Hubspot
  module Cms
    module Blogs
      module Tags
        class BlogTagsApi
          attr_accessor :api_client

          def initialize(api_client = ApiClient.default)
            @api_client = api_client
          end
          # Delete a Blog Tag
          # Delete the Blog Tag object identified by the id in the path.
          # @param object_id [String] The Blog Tag id.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Whether to return only results that have been archived.
          # @return [nil]
          def archive(object_id, opts = {})
            archive_with_http_info(object_id, opts)
            nil
          end

          # Delete a Blog Tag
          # Delete the Blog Tag object identified by the id in the path.
          # @param object_id [String] The Blog Tag id.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Whether to return only results that have been archived.
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def archive_with_http_info(object_id, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.archive ...'
            end
            # verify the required parameter 'object_id' is set
            if @api_client.config.client_side_validation && object_id.nil?
              fail ArgumentError, "Missing the required parameter 'object_id' when calling BlogTagsApi.archive"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body]

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.archive",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Delete a batch of Blog Tags
          # Delete the Blog Tag objects identified in the request body.
          # @param batch_input_string [BatchInputString] The JSON array of Blog Tag ids.
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def archive_batch(batch_input_string, opts = {})
            archive_batch_with_http_info(batch_input_string, opts)
            nil
          end

          # Delete a batch of Blog Tags
          # Delete the Blog Tag objects identified in the request body.
          # @param batch_input_string [BatchInputString] The JSON array of Blog Tag ids.
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def archive_batch_with_http_info(batch_input_string, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.archive_batch ...'
            end
            # verify the required parameter 'batch_input_string' is set
            if @api_client.config.client_side_validation && batch_input_string.nil?
              fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling BlogTagsApi.archive_batch"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/batch/archive'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.archive_batch",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#archive_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Attach a Blog Tag to a multi-language group
          # Attach a Blog Tag to a multi-language group.
          # @param attach_to_lang_primary_request_v_next [AttachToLangPrimaryRequestVNext] The JSON representation of the AttachToLangPrimaryRequest object.
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def attach_to_lang_group(attach_to_lang_primary_request_v_next, opts = {})
            attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, opts)
            nil
          end

          # Attach a Blog Tag to a multi-language group
          # Attach a Blog Tag to a multi-language group.
          # @param attach_to_lang_primary_request_v_next [AttachToLangPrimaryRequestVNext] The JSON representation of the AttachToLangPrimaryRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def attach_to_lang_group_with_http_info(attach_to_lang_primary_request_v_next, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.attach_to_lang_group ...'
            end
            # verify the required parameter 'attach_to_lang_primary_request_v_next' is set
            if @api_client.config.client_side_validation && attach_to_lang_primary_request_v_next.nil?
              fail ArgumentError, "Missing the required parameter 'attach_to_lang_primary_request_v_next' when calling BlogTagsApi.attach_to_lang_group"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/multi-language/attach-to-lang-group'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(attach_to_lang_primary_request_v_next)

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.attach_to_lang_group",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#attach_to_lang_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Create a new Blog Tag
          # Create a new Blog Tag.
          # @param tag [Tag] The JSON representation of a new Blog Tag.
          # @param [Hash] opts the optional parameters
          # @return [Tag]
          def create(tag, opts = {})
            data, _status_code, _headers = create_with_http_info(tag, opts)
            data
          end

          # Create a new Blog Tag
          # Create a new Blog Tag.
          # @param tag [Tag] The JSON representation of a new Blog Tag.
          # @param [Hash] opts the optional parameters
          # @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
          def create_with_http_info(tag, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.create ...'
            end
            # verify the required parameter 'tag' is set
            if @api_client.config.client_side_validation && tag.nil?
              fail ArgumentError, "Missing the required parameter 'tag' when calling BlogTagsApi.create"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(tag)

            # return_type
            return_type = opts[:debug_return_type] || 'Tag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.create",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Create a batch of Blog Tags
          # Create the Blog Tag objects detailed in the request body.
          # @param batch_input_tag [BatchInputTag] The JSON array of new Blog Tags to create.
          # @param [Hash] opts the optional parameters
          # @return [BatchResponseTag]
          def create_batch(batch_input_tag, opts = {})
            data, _status_code, _headers = create_batch_with_http_info(batch_input_tag, opts)
            data
          end

          # Create a batch of Blog Tags
          # Create the Blog Tag objects detailed in the request body.
          # @param batch_input_tag [BatchInputTag] The JSON array of new Blog Tags to create.
          # @param [Hash] opts the optional parameters
          # @return [Array<(BatchResponseTag, Integer, Hash)>] BatchResponseTag data, response status code and response headers
          def create_batch_with_http_info(batch_input_tag, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.create_batch ...'
            end
            # verify the required parameter 'batch_input_tag' is set
            if @api_client.config.client_side_validation && batch_input_tag.nil?
              fail ArgumentError, "Missing the required parameter 'batch_input_tag' when calling BlogTagsApi.create_batch"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/batch/create'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_tag)

            # return_type
            return_type = opts[:debug_return_type] || 'BatchResponseTag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.create_batch",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#create_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Create a new language variation
          # Create a new language variation from an existing Blog Tag
          # @param tag_clone_request_v_next [TagCloneRequestVNext] The JSON representation of the ContentLanguageCloneRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Tag]
          def create_lang_variation(tag_clone_request_v_next, opts = {})
            data, _status_code, _headers = create_lang_variation_with_http_info(tag_clone_request_v_next, opts)
            data
          end

          # Create a new language variation
          # Create a new language variation from an existing Blog Tag
          # @param tag_clone_request_v_next [TagCloneRequestVNext] The JSON representation of the ContentLanguageCloneRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
          def create_lang_variation_with_http_info(tag_clone_request_v_next, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.create_lang_variation ...'
            end
            # verify the required parameter 'tag_clone_request_v_next' is set
            if @api_client.config.client_side_validation && tag_clone_request_v_next.nil?
              fail ArgumentError, "Missing the required parameter 'tag_clone_request_v_next' when calling BlogTagsApi.create_lang_variation"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/multi-language/create-language-variation'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(tag_clone_request_v_next)

            # return_type
            return_type = opts[:debug_return_type] || 'Tag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.create_lang_variation",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#create_lang_variation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Detach a Blog Tag from a multi-language group
          # Detach a Blog Tag from a multi-language group.
          # @param detach_from_lang_group_request_v_next [DetachFromLangGroupRequestVNext] The JSON representation of the DetachFromLangGroupRequest object.
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def detach_from_lang_group(detach_from_lang_group_request_v_next, opts = {})
            detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, opts)
            nil
          end

          # Detach a Blog Tag from a multi-language group
          # Detach a Blog Tag from a multi-language group.
          # @param detach_from_lang_group_request_v_next [DetachFromLangGroupRequestVNext] The JSON representation of the DetachFromLangGroupRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def detach_from_lang_group_with_http_info(detach_from_lang_group_request_v_next, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.detach_from_lang_group ...'
            end
            # verify the required parameter 'detach_from_lang_group_request_v_next' is set
            if @api_client.config.client_side_validation && detach_from_lang_group_request_v_next.nil?
              fail ArgumentError, "Missing the required parameter 'detach_from_lang_group_request_v_next' when calling BlogTagsApi.detach_from_lang_group"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/multi-language/detach-from-lang-group'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(detach_from_lang_group_request_v_next)

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.detach_from_lang_group",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#detach_from_lang_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Retrieve a Blog Tag
          # Retrieve the Blog Tag object identified by the id in the path.
          # @param object_id [String] The Blog Tag id.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @option opts [String] :property 
          # @return [Tag]
          def get_by_id(object_id, opts = {})
            data, _status_code, _headers = get_by_id_with_http_info(object_id, opts)
            data
          end

          # Retrieve a Blog Tag
          # Retrieve the Blog Tag object identified by the id in the path.
          # @param object_id [String] The Blog Tag id.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @option opts [String] :property 
          # @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
          def get_by_id_with_http_info(object_id, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.get_by_id ...'
            end
            # verify the required parameter 'object_id' is set
            if @api_client.config.client_side_validation && object_id.nil?
              fail ArgumentError, "Missing the required parameter 'object_id' when calling BlogTagsApi.get_by_id"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
            query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body]

            # return_type
            return_type = opts[:debug_return_type] || 'Tag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.get_by_id",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#get_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Get all Blog Tags
          # Get the list of blog tags. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits. 
          # @param [Hash] opts the optional parameters
          # @option opts [Time] :created_at Only return Blog Tags created at exactly the specified time.
          # @option opts [Time] :created_after Only return Blog Tags created after the specified time.
          # @option opts [Time] :created_before Only return Blog Tags created before the specified time.
          # @option opts [Time] :updated_at Only return Blog Tags last updated at exactly the specified time.
          # @option opts [Time] :updated_after Only return Blog Tags last updated after the specified time.
          # @option opts [Time] :updated_before Only return Blog Tags last updated before the specified time.
          # @option opts [Array<String>] :sort Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.
          # @option opts [String] :after The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
          # @option opts [Integer] :limit The maximum number of results to return. Default is 100.
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @option opts [String] :property 
          # @return [CollectionResponseWithTotalTagForwardPaging]
          def get_page(opts = {})
            data, _status_code, _headers = get_page_with_http_info(opts)
            data
          end

          # Get all Blog Tags
          # Get the list of blog tags. Supports paging and filtering. This method would be useful for an integration that examined these models and used an external service to suggest edits. 
          # @param [Hash] opts the optional parameters
          # @option opts [Time] :created_at Only return Blog Tags created at exactly the specified time.
          # @option opts [Time] :created_after Only return Blog Tags created after the specified time.
          # @option opts [Time] :created_before Only return Blog Tags created before the specified time.
          # @option opts [Time] :updated_at Only return Blog Tags last updated at exactly the specified time.
          # @option opts [Time] :updated_after Only return Blog Tags last updated after the specified time.
          # @option opts [Time] :updated_before Only return Blog Tags last updated before the specified time.
          # @option opts [Array<String>] :sort Specifies which fields to use for sorting results. Valid fields are &#x60;name&#x60;, &#x60;createdAt&#x60;, &#x60;updatedAt&#x60;, &#x60;createdBy&#x60;, &#x60;updatedBy&#x60;. &#x60;createdAt&#x60; will be used by default.
          # @option opts [String] :after The cursor token value to get the next set of results. You can get this from the &#x60;paging.next.after&#x60; JSON property of a paged response containing more results.
          # @option opts [Integer] :limit The maximum number of results to return. Default is 100.
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @option opts [String] :property 
          # @return [Array<(CollectionResponseWithTotalTagForwardPaging, Integer, Hash)>] CollectionResponseWithTotalTagForwardPaging data, response status code and response headers
          def get_page_with_http_info(opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.get_page ...'
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags'

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'createdAt'] = opts[:'created_at'] if !opts[:'created_at'].nil?
            query_params[:'createdAfter'] = opts[:'created_after'] if !opts[:'created_after'].nil?
            query_params[:'createdBefore'] = opts[:'created_before'] if !opts[:'created_before'].nil?
            query_params[:'updatedAt'] = opts[:'updated_at'] if !opts[:'updated_at'].nil?
            query_params[:'updatedAfter'] = opts[:'updated_after'] if !opts[:'updated_after'].nil?
            query_params[:'updatedBefore'] = opts[:'updated_before'] if !opts[:'updated_before'].nil?
            query_params[:'sort'] = @api_client.build_collection_param(opts[:'sort'], :multi) if !opts[:'sort'].nil?
            query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
            query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?
            query_params[:'property'] = opts[:'property'] if !opts[:'property'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body]

            # return_type
            return_type = opts[:debug_return_type] || 'CollectionResponseWithTotalTagForwardPaging'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.get_page",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#get_page\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Retrieve a batch of Blog Tags
          # Retrieve the Blog Tag objects identified in the request body.
          # @param batch_input_string [BatchInputString] The JSON array of Blog Tag ids.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [BatchResponseTag]
          def read_batch(batch_input_string, opts = {})
            data, _status_code, _headers = read_batch_with_http_info(batch_input_string, opts)
            data
          end

          # Retrieve a batch of Blog Tags
          # Retrieve the Blog Tag objects identified in the request body.
          # @param batch_input_string [BatchInputString] The JSON array of Blog Tag ids.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to return deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [Array<(BatchResponseTag, Integer, Hash)>] BatchResponseTag data, response status code and response headers
          def read_batch_with_http_info(batch_input_string, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.read_batch ...'
            end
            # verify the required parameter 'batch_input_string' is set
            if @api_client.config.client_side_validation && batch_input_string.nil?
              fail ArgumentError, "Missing the required parameter 'batch_input_string' when calling BlogTagsApi.read_batch"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/batch/read'

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_string)

            # return_type
            return_type = opts[:debug_return_type] || 'BatchResponseTag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.read_batch",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#read_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Set a new primary language
          # Set a Blog Tag as the primary language of a multi-language group.
          # @param set_new_language_primary_request_v_next [SetNewLanguagePrimaryRequestVNext] The JSON representation of the SetNewLanguagePrimaryRequest object.
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def set_lang_primary(set_new_language_primary_request_v_next, opts = {})
            set_lang_primary_with_http_info(set_new_language_primary_request_v_next, opts)
            nil
          end

          # Set a new primary language
          # Set a Blog Tag as the primary language of a multi-language group.
          # @param set_new_language_primary_request_v_next [SetNewLanguagePrimaryRequestVNext] The JSON representation of the SetNewLanguagePrimaryRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def set_lang_primary_with_http_info(set_new_language_primary_request_v_next, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.set_lang_primary ...'
            end
            # verify the required parameter 'set_new_language_primary_request_v_next' is set
            if @api_client.config.client_side_validation && set_new_language_primary_request_v_next.nil?
              fail ArgumentError, "Missing the required parameter 'set_new_language_primary_request_v_next' when calling BlogTagsApi.set_lang_primary"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/multi-language/set-new-lang-primary'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(set_new_language_primary_request_v_next)

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.set_lang_primary",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#set_lang_primary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Update a Blog Tag
          # Sparse updates a single Blog Tag object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. 
          # @param object_id [String] The Blog Tag id.
          # @param tag [Tag] The JSON representation of the updated Blog Tag.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to update deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [Tag]
          def update(object_id, tag, opts = {})
            data, _status_code, _headers = update_with_http_info(object_id, tag, opts)
            data
          end

          # Update a Blog Tag
          # Sparse updates a single Blog Tag object identified by the id in the path. All the column values need not be specified. Only the that need to be modified can be specified. 
          # @param object_id [String] The Blog Tag id.
          # @param tag [Tag] The JSON representation of the updated Blog Tag.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to update deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [Array<(Tag, Integer, Hash)>] Tag data, response status code and response headers
          def update_with_http_info(object_id, tag, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.update ...'
            end
            # verify the required parameter 'object_id' is set
            if @api_client.config.client_side_validation && object_id.nil?
              fail ArgumentError, "Missing the required parameter 'object_id' when calling BlogTagsApi.update"
            end
            # verify the required parameter 'tag' is set
            if @api_client.config.client_side_validation && tag.nil?
              fail ArgumentError, "Missing the required parameter 'tag' when calling BlogTagsApi.update"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/{objectId}'.sub('{' + 'objectId' + '}', CGI.escape(object_id.to_s))

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(tag)

            # return_type
            return_type = opts[:debug_return_type] || 'Tag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.update",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Update a batch of Blog Tags
          # Update the Blog Tag objects identified in the request body.
          # @param batch_input_json_node [BatchInputJsonNode] A JSON array of the JSON representations of the updated Blog Tags.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to update deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [BatchResponseTag]
          def update_batch(batch_input_json_node, opts = {})
            data, _status_code, _headers = update_batch_with_http_info(batch_input_json_node, opts)
            data
          end

          # Update a batch of Blog Tags
          # Update the Blog Tag objects identified in the request body.
          # @param batch_input_json_node [BatchInputJsonNode] A JSON array of the JSON representations of the updated Blog Tags.
          # @param [Hash] opts the optional parameters
          # @option opts [Boolean] :archived Specifies whether to update deleted Blog Tags. Defaults to &#x60;false&#x60;.
          # @return [Array<(BatchResponseTag, Integer, Hash)>] BatchResponseTag data, response status code and response headers
          def update_batch_with_http_info(batch_input_json_node, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.update_batch ...'
            end
            # verify the required parameter 'batch_input_json_node' is set
            if @api_client.config.client_side_validation && batch_input_json_node.nil?
              fail ArgumentError, "Missing the required parameter 'batch_input_json_node' when calling BlogTagsApi.update_batch"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/batch/update'

            # query parameters
            query_params = opts[:query_params] || {}
            query_params[:'archived'] = opts[:'archived'] if !opts[:'archived'].nil?

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_input_json_node)

            # return_type
            return_type = opts[:debug_return_type] || 'BatchResponseTag'

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.update_batch",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#update_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end

          # Update languages of multi-language group
          # Explicitly set new languages for each Blog Tag in a multi-language group.
          # @param update_languages_request_v_next [UpdateLanguagesRequestVNext] The JSON representation of the UpdateLanguagesRequest object.
          # @param [Hash] opts the optional parameters
          # @return [nil]
          def update_langs(update_languages_request_v_next, opts = {})
            update_langs_with_http_info(update_languages_request_v_next, opts)
            nil
          end

          # Update languages of multi-language group
          # Explicitly set new languages for each Blog Tag in a multi-language group.
          # @param update_languages_request_v_next [UpdateLanguagesRequestVNext] The JSON representation of the UpdateLanguagesRequest object.
          # @param [Hash] opts the optional parameters
          # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
          def update_langs_with_http_info(update_languages_request_v_next, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: BlogTagsApi.update_langs ...'
            end
            # verify the required parameter 'update_languages_request_v_next' is set
            if @api_client.config.client_side_validation && update_languages_request_v_next.nil?
              fail ArgumentError, "Missing the required parameter 'update_languages_request_v_next' when calling BlogTagsApi.update_langs"
            end
            # resource path
            local_var_path = '/cms/v3/blogs/tags/multi-language/update-languages'

            # query parameters
            query_params = opts[:query_params] || {}

            # header parameters
            header_params = opts[:header_params] || {}
            # HTTP header 'Accept' (if needed)
            header_params['Accept'] = @api_client.select_header_accept(['*/*'])
            # HTTP header 'Content-Type'
            content_type = @api_client.select_header_content_type(['application/json'])
            if !content_type.nil?
                header_params['Content-Type'] = content_type
            end

            # form parameters
            form_params = opts[:form_params] || {}

            # http body (model)
            post_body = opts[:debug_body] || @api_client.object_to_http_body(update_languages_request_v_next)

            # return_type
            return_type = opts[:debug_return_type]

            # auth_names
            auth_names = opts[:debug_auth_names] || ['oauth2']

            new_options = opts.merge(
              :operation => :"BlogTagsApi.update_langs",
              :header_params => header_params,
              :query_params => query_params,
              :form_params => form_params,
              :body => post_body,
              :auth_names => auth_names,
              :return_type => return_type
            )

            data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
            if @api_client.config.debugging
              @api_client.config.logger.debug "API called: BlogTagsApi#update_langs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
            end
            return data, status_code, headers
          end
        end
      end
    end
  end
end
