Flagr::VariantApi

October 19, 2017 ยท View on GitHub

All URIs are relative to http://localhost/api/v1

MethodHTTP requestDescription
create_variantPOST /flags/{flagID}/variants
delete_variantDELETE /flags/{flagID}/variants/{variantID}
find_variantsGET /flags/{flagID}/variants
put_variantPUT /flags/{flagID}/variants/{variantID}

create_variant

Variant create_variant(flag_id, body)

Example

# load the gem
require 'rbflagr'

api_instance = Flagr::VariantApi.new

flag_id = 789 # Integer | numeric ID of the flag

body = Flagr::CreateVariantRequest.new # CreateVariantRequest | create a variant


begin
  result = api_instance.create_variant(flag_id, body)
  p result
rescue Flagr::ApiError => e
  puts "Exception when calling VariantApi->create_variant: #{e}"
end

Parameters

NameTypeDescriptionNotes
flag_idIntegernumeric ID of the flag
bodyCreateVariantRequestcreate a variant

Return type

Variant

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

delete_variant

delete_variant(flag_id, variant_id)

Example

# load the gem
require 'rbflagr'

api_instance = Flagr::VariantApi.new

flag_id = 789 # Integer | numeric ID of the flag

variant_id = 789 # Integer | numeric ID of the variant


begin
  api_instance.delete_variant(flag_id, variant_id)
rescue Flagr::ApiError => e
  puts "Exception when calling VariantApi->delete_variant: #{e}"
end

Parameters

NameTypeDescriptionNotes
flag_idIntegernumeric ID of the flag
variant_idIntegernumeric ID of the variant

Return type

nil (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

find_variants

Array<Variant> find_variants(flag_id)

Example

# load the gem
require 'rbflagr'

api_instance = Flagr::VariantApi.new

flag_id = 789 # Integer | numeric ID of the flag


begin
  result = api_instance.find_variants(flag_id)
  p result
rescue Flagr::ApiError => e
  puts "Exception when calling VariantApi->find_variants: #{e}"
end

Parameters

NameTypeDescriptionNotes
flag_idIntegernumeric ID of the flag

Return type

Array<Variant>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

put_variant

Variant put_variant(flag_id, variant_id, body)

Example

# load the gem
require 'rbflagr'

api_instance = Flagr::VariantApi.new

flag_id = 789 # Integer | numeric ID of the flag

variant_id = 789 # Integer | numeric ID of the variant

body = Flagr::PutVariantRequest.new # PutVariantRequest | update a variant


begin
  result = api_instance.put_variant(flag_id, variant_id, body)
  p result
rescue Flagr::ApiError => e
  puts "Exception when calling VariantApi->put_variant: #{e}"
end

Parameters

NameTypeDescriptionNotes
flag_idIntegernumeric ID of the flag
variant_idIntegernumeric ID of the variant
bodyPutVariantRequestupdate a variant

Return type

Variant

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json