class Flagr::TagApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/rbflagr/api/tag_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_tag(flag_id, body, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param body create a tag @param [Hash] opts the optional parameters @return [Tag]

# File lib/rbflagr/api/tag_api.rb, line 26
def create_tag(flag_id, body, opts = {})
  data, _status_code, _headers = create_tag_with_http_info(flag_id, body, opts)
  data
end
create_tag_with_http_info(flag_id, body, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param body create a tag @param [Hash] opts the optional parameters @return [Array<(Tag, Fixnum, Hash)>] Tag data, response status code and response headers

# File lib/rbflagr/api/tag_api.rb, line 35
def create_tag_with_http_info(flag_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TagApi.create_tag ...'
  end
  # verify the required parameter 'flag_id' is set
  if @api_client.config.client_side_validation && flag_id.nil?
    fail ArgumentError, "Missing the required parameter 'flag_id' when calling TagApi.create_tag"
  end
  if @api_client.config.client_side_validation && flag_id < 1
    fail ArgumentError, 'invalid value for "flag_id" when calling TagApi.create_tag, must be greater than or equal to 1.'
  end

  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling TagApi.create_tag"
  end
  # resource path
  local_var_path = '/flags/{flagID}/tags'.sub('{' + 'flagID' + '}', flag_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Tag')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagApi#create_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_tag(flag_id, tag_id, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param tag_id numeric ID of the tag @param [Hash] opts the optional parameters @return [nil]

# File lib/rbflagr/api/tag_api.rb, line 86
def delete_tag(flag_id, tag_id, opts = {})
  delete_tag_with_http_info(flag_id, tag_id, opts)
  nil
end
delete_tag_with_http_info(flag_id, tag_id, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param tag_id numeric ID of the tag @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/rbflagr/api/tag_api.rb, line 95
def delete_tag_with_http_info(flag_id, tag_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TagApi.delete_tag ...'
  end
  # verify the required parameter 'flag_id' is set
  if @api_client.config.client_side_validation && flag_id.nil?
    fail ArgumentError, "Missing the required parameter 'flag_id' when calling TagApi.delete_tag"
  end
  if @api_client.config.client_side_validation && flag_id < 1
    fail ArgumentError, 'invalid value for "flag_id" when calling TagApi.delete_tag, must be greater than or equal to 1.'
  end

  # verify the required parameter 'tag_id' is set
  if @api_client.config.client_side_validation && tag_id.nil?
    fail ArgumentError, "Missing the required parameter 'tag_id' when calling TagApi.delete_tag"
  end
  if @api_client.config.client_side_validation && tag_id < 1
    fail ArgumentError, 'invalid value for "tag_id" when calling TagApi.delete_tag, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/flags/{flagID}/tags/{tagID}'.sub('{' + 'flagID' + '}', flag_id.to_s).sub('{' + 'tagID' + '}', tag_id.to_s)

  # query parameters
  query_params = {}

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

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagApi#delete_tag\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
find_all_tags(opts = {}) click to toggle source

@param [Hash] opts the optional parameters @option opts [Integer] :limit the numbers of tags to return @option opts [Integer] :offset return tags given the offset, it should usually set together with limit @option opts [String] :value_like return tags partially matching given value @return [Array<Tag>]

# File lib/rbflagr/api/tag_api.rb, line 150
def find_all_tags(opts = {})
  data, _status_code, _headers = find_all_tags_with_http_info(opts)
  data
end
find_all_tags_with_http_info(opts = {}) click to toggle source

@param [Hash] opts the optional parameters @option opts [Integer] :limit the numbers of tags to return @option opts [Integer] :offset return tags given the offset, it should usually set together with limit @option opts [String] :value_like return tags partially matching given value @return [Array<(Array<Tag>, Fixnum, Hash)>] Array<Tag> data, response status code and response headers

# File lib/rbflagr/api/tag_api.rb, line 160
def find_all_tags_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TagApi.find_all_tags ...'
  end
  # resource path
  local_var_path = '/tags'

  # query parameters
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'value_like'] = opts[:'value_like'] if !opts[:'value_like'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['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 => 'Array<Tag>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagApi#find_all_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
find_tags(flag_id, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param [Hash] opts the optional parameters @return [Array<Tag>]

# File lib/rbflagr/api/tag_api.rb, line 201
def find_tags(flag_id, opts = {})
  data, _status_code, _headers = find_tags_with_http_info(flag_id, opts)
  data
end
find_tags_with_http_info(flag_id, opts = {}) click to toggle source

@param flag_id numeric ID of the flag @param [Hash] opts the optional parameters @return [Array<(Array<Tag>, Fixnum, Hash)>] Array<Tag> data, response status code and response headers

# File lib/rbflagr/api/tag_api.rb, line 209
def find_tags_with_http_info(flag_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TagApi.find_tags ...'
  end
  # verify the required parameter 'flag_id' is set
  if @api_client.config.client_side_validation && flag_id.nil?
    fail ArgumentError, "Missing the required parameter 'flag_id' when calling TagApi.find_tags"
  end
  if @api_client.config.client_side_validation && flag_id < 1
    fail ArgumentError, 'invalid value for "flag_id" when calling TagApi.find_tags, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/flags/{flagID}/tags'.sub('{' + 'flagID' + '}', flag_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['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 => 'Array<Tag>')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TagApi#find_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end