Class: GogoKit::Client
- Inherits:
-
Object
- Object
- GogoKit::Client
- Includes:
- Address, Category, Country, Currency, Event, Language, Listing, MetroArea, OAuth, PaymentMethod, Root, Search, SellerListing, User, Venue, Configuration, Connection
- Defined in:
- lib/gogokit/client.rb,
lib/gogokit/client/root.rb,
lib/gogokit/client/user.rb,
lib/gogokit/client/event.rb,
lib/gogokit/client/oauth.rb,
lib/gogokit/client/venue.rb,
lib/gogokit/client/search.rb,
lib/gogokit/client/address.rb,
lib/gogokit/client/country.rb,
lib/gogokit/client/listing.rb,
lib/gogokit/client/category.rb,
lib/gogokit/client/currency.rb,
lib/gogokit/client/language.rb,
lib/gogokit/client/metro_area.rb,
lib/gogokit/client/payment_method.rb,
lib/gogokit/client/seller_listing.rb
Overview
Client for the viagogo API
Defined Under Namespace
Modules: Address, Category, Country, Currency, Event, Language, Listing, MetroArea, OAuth, PaymentMethod, Root, Search, SellerListing, User, Venue
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#client_id ⇒ Object
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
Returns the value of attribute client_secret.
Attributes included from Configuration
#api_root_endpoint, #oauth_token_endpoint
Instance Method Summary collapse
-
#delete(url, options = {}) ⇒ Hash
Perform an HTTP DELETE request.
-
#get(url, options = {}) ⇒ Hash
Perform an HTTP GET request.
-
#head(url, options = {}) ⇒ Hash
Perform an HTTP HEAD request.
-
#initialize(options = {}) {|_self| ... } ⇒ GogoKit::Client
constructor
Initializes a new Client.
-
#patch(url, options = {}) ⇒ Hash
Perform an HTTP PATCH request.
-
#post(url, options = {}) ⇒ Hash
Perform an HTTP POST request.
-
#put(url, options = {}) ⇒ Hash
Perform an HTTP PUT request.
-
#user_agent ⇒ String
The User-Agent header used when making HTTP requests.
Methods included from Venue
Methods included from Utils
Methods included from User
Methods included from SellerListing
#create_seller_listing, #create_seller_listing_preview, #create_seller_listing_update_preview, #delete_seller_listing, #get_listing_constraints, #get_listing_constraints_for_event, #get_seller_listing, #get_seller_listings, #update_seller_listing
Methods included from Search
Methods included from Root
Methods included from PaymentMethod
Methods included from OAuth
#get_access_token, #get_client_access_token
Methods included from MetroArea
#get_metro_area, #get_metro_areas
Methods included from Listing
#get_listing, #get_listings_by_event
Methods included from Language
Methods included from Event
#get_event, #get_events_by_category
Methods included from Currency
#get_currencies, #get_currency
Methods included from Country
Methods included from Category
Methods included from Address
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ GogoKit::Client
Initializes a new GogoKit::Client
OAuth access tokens client credentials are not a String or Symbol.
60 61 62 63 64 65 66 67 68 |
# File 'lib/gogokit/client.rb', line 60 def initialize( = {}) .each do |key, value| send(:"#{key}=", value) end yield self if block_given? validate_credential_type! validate_configuration! end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
46 47 48 |
# File 'lib/gogokit/client.rb', line 46 def access_token @access_token end |
#client_id ⇒ Object
Returns the value of attribute client_id.
46 47 48 |
# File 'lib/gogokit/client.rb', line 46 def client_id @client_id end |
#client_secret ⇒ Object
Returns the value of attribute client_secret.
46 47 48 |
# File 'lib/gogokit/client.rb', line 46 def client_secret @client_secret end |
Instance Method Details
#delete(url, options = {}) ⇒ Hash
Perform an HTTP DELETE request
80 81 82 |
# File 'lib/gogokit/client.rb', line 80 def delete(url, = {}) request(:delete, url, ) end |
#get(url, options = {}) ⇒ Hash
Perform an HTTP GET request
87 88 89 |
# File 'lib/gogokit/client.rb', line 87 def get(url, = {}) request(:get, url, ) end |
#head(url, options = {}) ⇒ Hash
Perform an HTTP HEAD request
94 95 96 |
# File 'lib/gogokit/client.rb', line 94 def head(url, = {}) request(:head, url, ) end |
#patch(url, options = {}) ⇒ Hash
Perform an HTTP PATCH request
101 102 103 |
# File 'lib/gogokit/client.rb', line 101 def patch(url, = {}) request(:patch, url, ) end |
#post(url, options = {}) ⇒ Hash
Perform an HTTP POST request
108 109 110 |
# File 'lib/gogokit/client.rb', line 108 def post(url, = {}) request(:post, url, ) end |
#put(url, options = {}) ⇒ Hash
Perform an HTTP PUT request
115 116 117 |
# File 'lib/gogokit/client.rb', line 115 def put(url, = {}) request(:put, url, ) end |
#user_agent ⇒ String
The User-Agent header used when making HTTP requests
73 74 75 |
# File 'lib/gogokit/client.rb', line 73 def user_agent @user_agent ||= "GogoKit Ruby Gem #{GogoKit::VERSION}" end |