=begin
#DocuSign Rooms API - v2

#An API for an integrator to access the features of DocuSign Rooms

OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git

=end

require "uri"

module DocuSign_Rooms

  class GetFieldSetOptions
    # A comma-separated list that limits the fields to return:\\n\\n- `IsRequiredOnCreate`: include fields that are required in room creation.\\n- `IsRequiredOnSubmit`: include fields that are required when submitting a room for review.\\n
    attr_accessor :fields_custom_data_filters

    def self.default
      @@default ||= GetFieldSetOptions.new
    end
  end


  class FieldsApi
    attr_accessor :api_client

    def initialize(api_client = FieldsApi.default)
      @api_client = api_client
    end

    # Get details of a specific field set.
    # Get details of a specific field set.
    # @param field_set_id The id of the field set.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param DocuSign_Rooms::GetFieldSetOptions Options for modifying the behavior of the function.
    # @return [FieldSet]
    def get_field_set(field_set_id, account_id, options = DocuSign_Rooms::GetFieldSetOptions.default)
      data, _status_code, _headers = get_field_set_with_http_info(field_set_id, account_id, options)
      return data
    end

    # Get details of a specific field set.
    # Get details of a specific field set.
    # @param field_set_id The id of the field set.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param DocuSign_Rooms::GetFieldSetOptions Options for modifying the behavior of the function.
    # @return [Array<(FieldSet, Fixnum, Hash)>] FieldSet data, response status code and response headers
    def get_field_set_with_http_info(field_set_id, account_id, options = DocuSign_Rooms::GetFieldSetOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: FieldsApi.get_field_set ..."
      end
      # verify the required parameter 'field_set_id' is set
      fail ArgumentError, "Missing the required parameter 'field_set_id' when calling FieldsApi.get_field_set" if field_set_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling FieldsApi.get_field_set" if account_id.nil?
      if options.fields_custom_data_filters && !options.fields_custom_data_filters.all?{|item| ['None', 'IsRequiredOnCreate', 'IsRequiredOnSubmit'].include?(item)}
        fail ArgumentError, 'invalid value for "fields_custom_data_filters", must include one of None, IsRequiredOnCreate, IsRequiredOnSubmit'
      end
      # resource path
      local_var_path = "/v2/accounts/{accountId}/field_sets/{fieldSetId}".sub('{format}','json').sub('{' + 'fieldSetId' + '}', field_set_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'fieldsCustomDataFilters'] = @api_client.build_collection_param(options.fields_custom_data_filters, :csv) if !options.fields_custom_data_filters.nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['text/plain', 'application/json', 'text/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json-patch+json', 'application/json', 'text/json', 'application/*+json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'FieldSet')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: FieldsApi#get_field_set\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end