gogokit 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDY1MDA2YjY5NTUyNmFjNzIzNjljNjNkNzUwYzM1MDU1YjlkNWY5Nw==
4
+ MWVkMTVkMmRmMzc0ZTYzNTVjYTg2ZDVhZWNlYzMzMjVkZjk2MDZmMw==
5
5
  data.tar.gz: !binary |-
6
- ODUxMjIyZGY2MDk3ODA0ZTM3NTFiYmRlNmQxYThkNjc4YjU4NjYxNg==
6
+ ZTQyNjU2M2Q5NzJhOGUyYjAyZTdjNWM2NjY1MzgzYTQ1YWUzYWM3Nw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTRhYjI4YTk2YTMzNTE3MTRkY2YwMjNmZjRiMjQ3MmY3ZDVkODhlNjlhMjQ1
10
- NDU2MGVmNDU1ZGViYTM3ZWNiMDkxYTg3YTg0NDY0OTc5MjJhY2E3NTJiMTc3
11
- NDUzYTFhMzJjYjc3ZTgwOWM3Yzk5ZWIzMTQ1ZGJjYjJhM2NlN2M=
9
+ MjgxZGFjZjhiMGQ4OTFiMThlYWUyNTM0N2JjNDkyZDhhYjkxZWUyYzIwM2U3
10
+ NmI3Y2Q3NDFhOGQwNzE4ZTJiMWRmNGI4MDg2NDM2NzZjYzdmMTQ3ZTcxMmM0
11
+ M2ExNmVkMDlhNTQxZGEyNjg4ZTZkMWQ5ZDA5Y2NkOTczZWIzYzA=
12
12
  data.tar.gz: !binary |-
13
- NmU2ZmY4NDc2NTcyZTc5NzY3ZDNlYzYxZTVhZTcxNjlkNzViOGMxMmJjNDcx
14
- YTg2NDEyOWZiMjJhOWZhZTQ3ZmRhMzViZGQ0OGVhYjViMDFhN2IxNjIxYTg4
15
- OTdhMmU4MmFmNTUzMjJkOGUyMTA0Y2NiYWIyYTYyMGY5ZmI3NWI=
13
+ NzZmZGUyYjY0YjAwMTQ3NmU0MzMyMzliNTU4YTBhOTAyZGU4MmI3MTE0NGIw
14
+ OTljMjk3MzkzZjkxYzUyZDM4NGE1ODhhMDkzNTA3YmRjNGE5ZmU1Y2FiYmFl
15
+ ODQ1Yzc0M2IwNGQ0ODcyN2YyYWY5YTNkNTVhMDQ1OTY2ZGIyZDk=
data/README.md CHANGED
@@ -1,18 +1,121 @@
1
1
  # The GogoKit Ruby Gem
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/gogokit.svg)][gem]
4
+ [![Downloads](https://img.shields.io/gem/dt/gogokit.svg)][gem]
3
5
  [![Build Status](https://travis-ci.org/viagogo/gogokit.rb.svg?branch=master)][travis]
4
6
  [![Dependency Status](https://gemnasium.com/viagogo/gogokit.rb.svg)][gemnasium]
5
7
  [![Code Climate](https://codeclimate.com/github/viagogo/gogokit.rb/badges/gpa.svg)][codeclimate]
6
8
  [![Coverage Status](https://coveralls.io/repos/viagogo/gogokit.rb/badge.svg)][coverage]
7
9
 
10
+ [gem]: https://rubygems.org/gems/gogokit
8
11
  [travis]: https://travis-ci.org/viagogo/gogokit.rb
9
12
  [gemnasium]: https://gemnasium.com/viagogo/gogokit.rb
10
13
  [codeclimate]: https://codeclimate.com/github/viagogo/gogokit.rb
11
14
  [coverage]: https://coveralls.io/r/viagogo/gogokit.rb
15
+ [apidocs]: http://developer.viagogo.net
16
+ [semver]: http://semver.org/
17
+ [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
18
+ [troubleshootwindows]: https://github.com/jnunemaker/httparty/wiki/Troubleshooting-on-Windows
19
+ [submitanissue]: https://github.com/viagogo/gogokit.rb/issues
20
+ [apidocsgettingstarted]: http://developer.viagogo.net/#getting-started
12
21
 
13
22
 
14
- Ruby toolkit for working with the viagogo API
23
+ Ruby toolkit for working with the viagogo API. Our [developer site][apidocs]
24
+ documents all of the viagogo APIs.
15
25
 
16
- ## Troubleshooting on Windows
17
26
 
18
- GogoKit uses SSL for all HTTP requests. On Windows you will need to configure where your certificates live since OpenSSL cannot find one to validate the authenticity. [This post](https://github.com/jnunemaker/httparty/wiki/Troubleshooting-on-Windows) describes how you can get this working on windows.
27
+ ## Installation
28
+
29
+ Install via Ruby gems
30
+
31
+ gem install gogokit
32
+
33
+ ... or add to your Gemfile
34
+
35
+ gem 'gogokit', '~> 0.2'
36
+
37
+
38
+ ## Usage
39
+
40
+ See our [developer site][apidocsgettingstarted] for more examples.
41
+
42
+ ```ruby
43
+ require 'gogokit'
44
+
45
+ # All methods require OAuth2 authentication. To get OAuth2 credentials for your
46
+ # application, see http://developer.viagogo.net/#authentication.
47
+ client = GogoKit::Client.new do |config|
48
+ config.client_id = YOUR_CLIENT_ID
49
+ config.client_secret = YOUR_CLIENT_SECRET
50
+ end
51
+
52
+ # Get an access token. See http://developer.viagogo.net/#getting-access-tokens
53
+ token = client.get_client_access_token
54
+ client.access_token = token.access_token
55
+
56
+ # Get a list of events, categories, venues and metro areas that match the given
57
+ # search query
58
+ search_results = client.search 'FC Barcelona tickets'
59
+
60
+ # Get the different event genres (see http://developer.viagogo.net/#entities)
61
+ genres = client.get_genres
62
+ ```
63
+
64
+
65
+ ## How to contribute
66
+
67
+ All submissions are welcome. Fork the repository, read the rest of this README
68
+ file and make some changes. Once you're done with your changes send a pull
69
+ request. Thanks!
70
+
71
+
72
+ ## Need Help? Found a bug?
73
+
74
+ Just [submit a issue][submitanissue] if you need any help. And, of course, feel
75
+ free to submit pull requests with bug fixes or changes.
76
+
77
+
78
+ ## Supported Ruby Versions
79
+
80
+ This library aims to support and is [tested against][travis] the following Ruby
81
+ implementations:
82
+
83
+ * Ruby 1.9.3
84
+ * Ruby 2.0.0
85
+ * Ruby 2.1.0
86
+ * Ruby 2.2.0
87
+
88
+ If something doesn't work on one of these Ruby versions, it's a bug.
89
+
90
+ This library may inadvertently work (or seem to work) on other Ruby
91
+ implementations, but support will only be provided for the versions listed
92
+ above.
93
+
94
+ If you would like this library to support another Ruby version, you may
95
+ volunteer to be a maintainer. Being a maintainer entails making sure all tests
96
+ run and pass on that implementation. When something breaks on your
97
+ implementation, you will be responsible for providing patches in a timely
98
+ fashion. If critical issues for a particular implementation exist at the time
99
+ of a major release, support for that Ruby version may be dropped.
100
+
101
+
102
+ ### Troubleshooting on Windows
103
+
104
+ GogoKit uses SSL for all HTTP requests. On Windows you will need to configure
105
+ where your certificates live since OpenSSL cannot find one to validate
106
+ the authenticity. [This post][troubleshootwindows] describes how you can get
107
+ this working on windows.
108
+
109
+
110
+ ## Versioning
111
+
112
+ This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
113
+ of this scheme should be reported as bugs. Specifically, if a minor or patch
114
+ version is released that breaks backward compatibility, that version should be
115
+ immediately yanked and/or a new version should be immediately released that
116
+ restores compatibility. Breaking changes to the public API will only be
117
+ introduced with new major versions. As a result of this policy, you can (and
118
+ should) specify a dependency on this gem using the [Pessimistic Version
119
+ Constraint][pvc] with two digits of precision. For example:
120
+
121
+ spec.add_dependency 'gogokit', '~> 0.1'
@@ -3,6 +3,7 @@ require 'addressable/template'
3
3
  require 'gogokit/configuration'
4
4
  require 'gogokit/connection'
5
5
  require 'gogokit/error'
6
+ require 'gogokit/client/address'
6
7
  require 'gogokit/client/category'
7
8
  require 'gogokit/client/country'
8
9
  require 'gogokit/client/currency'
@@ -11,8 +12,11 @@ require 'gogokit/client/language'
11
12
  require 'gogokit/client/listing'
12
13
  require 'gogokit/client/metro_area'
13
14
  require 'gogokit/client/oauth'
15
+ require 'gogokit/client/payment_method'
14
16
  require 'gogokit/client/root'
15
17
  require 'gogokit/client/search'
18
+ require 'gogokit/client/seller_listing'
19
+ require 'gogokit/client/user'
16
20
  require 'gogokit/client/venue'
17
21
  require 'gogokit/version'
18
22
 
@@ -23,6 +27,7 @@ module GogoKit
23
27
  class Client
24
28
  include GogoKit::Configuration
25
29
  include GogoKit::Connection
30
+ include GogoKit::Client::Address
26
31
  include GogoKit::Client::Category
27
32
  include GogoKit::Client::Country
28
33
  include GogoKit::Client::Currency
@@ -31,8 +36,11 @@ module GogoKit
31
36
  include GogoKit::Client::Listing
32
37
  include GogoKit::Client::MetroArea
33
38
  include GogoKit::Client::OAuth
39
+ include GogoKit::Client::PaymentMethod
34
40
  include GogoKit::Client::Root
35
41
  include GogoKit::Client::Search
42
+ include GogoKit::Client::SellerListing
43
+ include GogoKit::Client::User
36
44
  include GogoKit::Client::Venue
37
45
 
38
46
  attr_accessor :client_id,
@@ -0,0 +1,26 @@
1
+ require 'gogokit/utils'
2
+ require 'gogokit/resource/address'
3
+
4
+ module GogoKit
5
+ class Client
6
+ # {GogoKit::Client} methods for getting addresses for the authenticated user
7
+ module Address
8
+ include GogoKit::Utils
9
+
10
+ # Retrieves all addresses for the authenticated user
11
+ #
12
+ # @see http://developer.viagogo.net/#useraddresses
13
+ # @param [Hash] options Optional options
14
+ # @return [GogoKit::PagedResource] All addresses for the authenticated
15
+ # user
16
+ def get_addresses(options = {})
17
+ root = get_root
18
+ object_from_response(GogoKit::PagedResource,
19
+ GogoKit::AddressesRepresenter,
20
+ :get,
21
+ "#{root.links['self'].href}/addresses",
22
+ options)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
1
+ require 'gogokit/utils'
2
+ require 'gogokit/resource/payment_method'
3
+
4
+ module GogoKit
5
+ class Client
6
+ # {GogoKit::Client} methods for getting payment methods for the
7
+ # authenticated user
8
+ module PaymentMethod
9
+ include GogoKit::Utils
10
+
11
+ # Retrieves all payment methods for the authenticated user
12
+ #
13
+ # @see http://developer.viagogo.net/#userpaymentmethods
14
+ # @param [Hash] options Optional options
15
+ # @return [GogoKit::PagedResource] All payment methods for the
16
+ # authenticated user
17
+ def get_payment_methods(options = {})
18
+ root = get_root
19
+ object_from_response(GogoKit::PagedResource,
20
+ GogoKit::PaymentMethodsRepresenter,
21
+ :get,
22
+ "#{root.links['self'].href}/paymentmethods",
23
+ options)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,144 @@
1
+ require 'gogokit/utils'
2
+ require 'gogokit/resource/listing_constraints'
3
+ require 'gogokit/resource/seller_listing'
4
+
5
+ module GogoKit
6
+ class Client
7
+ # {GogoKit::Client} methods for getting seller_listings
8
+ module SellerListing
9
+ include GogoKit::Utils
10
+
11
+ # Retrieves a listing by ID
12
+ #
13
+ # @param [Integer] listing_id The ID of the listing to be retrieved
14
+ # @param [Hash] options Optional options
15
+ # @return [GogoKit::SellerListing] The requested listing
16
+ def get_seller_listing(listing_id, options = {})
17
+ root = get_root
18
+ object_from_response(GogoKit::SellerListing,
19
+ GogoKit::SellerListingRepresenter,
20
+ :get,
21
+ "#{root.links['self'].href}/sellerlistings/" \
22
+ "#{listing_id}",
23
+ options)
24
+ end
25
+
26
+ # Retrieves all listings for the authenticated user
27
+ #
28
+ # @see http://developer.viagogo.net/#usersellerlistings
29
+ # @param [Hash] options Optional options
30
+ # @return [GogoKit::PagedResource] All listings for the authenticated user
31
+ def get_seller_listings(options = {})
32
+ root = get_root
33
+ object_from_response(GogoKit::PagedResource,
34
+ GogoKit::SellerListingsRepresenter,
35
+ :get,
36
+ "#{root.links['self'].href}/sellerlistings",
37
+ options)
38
+ end
39
+
40
+ # Retrieves the constraints for creating a listing for an event
41
+ #
42
+ # @param [Integer] event_id The ID of the event
43
+ # @param [Hash] options Optional options
44
+ # @return [GogoKit::ListingConstraints] The constraints for creating a
45
+ # listing for an event
46
+ def get_listing_constraints_for_event(event_id, options = {})
47
+ root = get_root
48
+ object_from_response(GogoKit::ListingConstraints,
49
+ GogoKit::ListingConstraintsRepresenter,
50
+ :get,
51
+ "#{root.links['self'].href}/events/#{event_id}" \
52
+ '/listingconstraints',
53
+ options)
54
+ end
55
+
56
+ # Retrieves the constraints for updating a listing
57
+ #
58
+ # @param [Integer] listing_id The ID of the listing
59
+ # @param [Hash] options Optional options
60
+ # @return [GogoKit::ListingConstraints] The constraints for updating a
61
+ # listing
62
+ def get_listing_constraints(listing_id, options = {})
63
+ root = get_root
64
+ object_from_response(GogoKit::ListingConstraints,
65
+ GogoKit::ListingConstraintsRepresenter,
66
+ :get,
67
+ "#{root.links['self'].href}/sellerlistings/" \
68
+ "#{listing_id}/constraints",
69
+ options)
70
+ end
71
+
72
+ # Creates a preview of a listing for an event
73
+ #
74
+ # @param [Integer] event_id The ID of the event
75
+ # @param [Hash] options Optional options
76
+ # @return [GogoKit::SellerListing] The preview of a listing for an event
77
+ def create_seller_listing_preview(event_id, options = {})
78
+ root = get_root
79
+ object_from_response(GogoKit::SellerListing,
80
+ GogoKit::SellerListingRepresenter,
81
+ :post,
82
+ "#{root.links['self'].href}/events/" \
83
+ "#{event_id}/sellerlistingpreview",
84
+ options)
85
+ end
86
+
87
+ # Creates a preview of an update to a listing
88
+ #
89
+ # @param [Integer] listing_id The ID of the listing
90
+ # @param [Hash] options Optional options
91
+ # @return [GogoKit::SellerListing] The preview of a listing for an event
92
+ def create_seller_listing_update_preview(listing_id, options = {})
93
+ root = get_root
94
+ object_from_response(GogoKit::SellerListing,
95
+ GogoKit::SellerListingRepresenter,
96
+ :post,
97
+ "#{root.links['self'].href}/sellerlistings/" \
98
+ "#{listing_id}/updatepreview",
99
+ options)
100
+ end
101
+
102
+ # Creates a listing for an event
103
+ #
104
+ # @param [Integer] event_id The ID of the event
105
+ # @param [Hash] options Optional options
106
+ # @return [GogoKit::SellerListing] The newly created listing
107
+ def create_seller_listing(event_id, options = {})
108
+ root = get_root
109
+ object_from_response(GogoKit::SellerListing,
110
+ GogoKit::SellerListingRepresenter,
111
+ :post,
112
+ "#{root.links['self'].href}/events/" \
113
+ "#{event_id}/sellerlistings",
114
+ options)
115
+ end
116
+
117
+ # Updates an existing listing
118
+ #
119
+ # @param [Integer] listing_id The ID of the listing
120
+ # @param [Hash] options Optional options
121
+ # @return [GogoKit::SellerListing] The updated created listing
122
+ def update_seller_listing(listing_id, options = {})
123
+ root = get_root
124
+ object_from_response(GogoKit::SellerListing,
125
+ GogoKit::SellerListingRepresenter,
126
+ :patch,
127
+ "#{root.links['self'].href}/sellerlistings/" \
128
+ "#{listing_id}",
129
+ options)
130
+ end
131
+
132
+ # Deletes a listing
133
+ #
134
+ # @param [Integer] listing_id The ID of the listing
135
+ # @param [Hash] options Optional options
136
+ # @return [Hash] object containing response information
137
+ def delete_seller_listing(listing_id, options = {})
138
+ root = get_root
139
+ delete("#{root.links['self'].href}/sellerlistings/#{listing_id}",
140
+ options)
141
+ end
142
+ end
143
+ end
144
+ end
@@ -0,0 +1,23 @@
1
+ require 'gogokit/utils'
2
+ require 'gogokit/resource/user'
3
+
4
+ module GogoKit
5
+ class Client
6
+ # {GogoKit::Client} methods for getting and updating the authenticated user
7
+ module User
8
+ include GogoKit::Utils
9
+
10
+ # Retrieves account information for the authenticated user
11
+ #
12
+ # @param [Hash] options Optional options
13
+ # @return [GogoKit::User] The authenticated user
14
+ def get_user(options = {})
15
+ object_from_response(GogoKit::User,
16
+ GogoKit::UserRepresenter,
17
+ :get,
18
+ get_root.links['viagogo:user'].href,
19
+ options)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,50 @@
1
+ require 'gogokit/resource'
2
+ require 'gogokit/paged_resource'
3
+ require 'gogokit/resource/country'
4
+
5
+ module GogoKit
6
+ # @see http://developer.viagogo.net/#address
7
+ class Address < Resource
8
+ attr_accessor :id,
9
+ :full_name,
10
+ :address_1,
11
+ :address_2,
12
+ :address_3,
13
+ :city,
14
+ :state_province,
15
+ :postal_code,
16
+ :latitude,
17
+ :longitude,
18
+ :country
19
+ end
20
+
21
+ module AddressRepresenter
22
+ include Representable::JSON
23
+ include GogoKit::ResourceRepresenter
24
+
25
+ property :id
26
+ property :full_name
27
+ property :address_1
28
+ property :address_2
29
+ property :address_3
30
+ property :city
31
+ property :state_province
32
+ property :postal_code
33
+ property :latitude
34
+ property :longitude
35
+ property :country,
36
+ class: Country,
37
+ extend: CountryRepresenter,
38
+ embedded: true
39
+ end
40
+
41
+ module AddressesRepresenter
42
+ include Representable::JSON
43
+ include GogoKit::PagedResourceRepresenter
44
+
45
+ collection :items,
46
+ class: Address,
47
+ extend: AddressRepresenter,
48
+ embedded: true
49
+ end
50
+ end
@@ -1,4 +1,6 @@
1
1
  require 'gogokit/resource'
2
+ require 'gogokit/paged_resource'
3
+ require 'gogokit/resource/country'
2
4
 
3
5
  module GogoKit
4
6
  # @see http://viagogo.github.io/developer.viagogo.net/#country
@@ -0,0 +1,65 @@
1
+ require 'gogokit/resource'
2
+ require 'gogokit/resource/currency'
3
+ require 'gogokit/resource/listing_note'
4
+ require 'gogokit/resource/split_type'
5
+ require 'gogokit/resource/ticket_type'
6
+ require 'gogokit/section'
7
+
8
+ module GogoKit
9
+ # @see http://viagogo.github.io/developer.viagogo.net/#listingconstraint
10
+ class ListingConstraints < Resource
11
+ attr_accessor :min_ticket_price,
12
+ :max_ticket_price,
13
+ :min_number_of_tickets,
14
+ :max_number_of_tickets,
15
+ :ticket_location_required,
16
+ :seats_required,
17
+ :sections,
18
+ :ticket_types,
19
+ :split_types,
20
+ :listing_notes,
21
+ :currencies
22
+ end
23
+
24
+ module ListingConstraintsRepresenter
25
+ include Representable::JSON
26
+ include GogoKit::ResourceRepresenter
27
+
28
+ property :min_ticket_price,
29
+ class: GogoKit::Money,
30
+ extend: GogoKit::MoneyRepresenter,
31
+ skip_parse: ->(fragment, _) { fragment.nil? }
32
+ property :max_ticket_price,
33
+ class: GogoKit::Money,
34
+ extend: GogoKit::MoneyRepresenter,
35
+ skip_parse: ->(fragment, _) { fragment.nil? }
36
+ property :min_number_of_tickets
37
+ property :max_number_of_tickets
38
+ property :ticket_location_required
39
+ property :seats_required
40
+ collection :sections,
41
+ class: GogoKit::Section,
42
+ extend: GogoKit::SectionRepresenter,
43
+ skip_parse: ->(fragment, _) { fragment.nil? }
44
+ collection :ticket_types,
45
+ class: GogoKit::TicketType,
46
+ extend: GogoKit::TicketTypeRepresenter,
47
+ skip_parse: ->(fragment, _) { fragment.nil? },
48
+ embedded: true
49
+ collection :split_types,
50
+ class: GogoKit::SplitType,
51
+ extend: GogoKit::SplitTypeRepresenter,
52
+ skip_parse: ->(fragment, _) { fragment.nil? },
53
+ embedded: true
54
+ collection :listing_notes,
55
+ class: GogoKit::ListingNote,
56
+ extend: GogoKit::ListingNoteRepresenter,
57
+ skip_parse: ->(fragment, _) { fragment.nil? },
58
+ embedded: true
59
+ collection :currencies,
60
+ class: GogoKit::Currency,
61
+ extend: GogoKit::CurrencyRepresenter,
62
+ skip_parse: ->(fragment, _) { fragment.nil? },
63
+ embedded: true
64
+ end
65
+ end
@@ -0,0 +1,46 @@
1
+ require 'gogokit/resource'
2
+ require 'gogokit/paged_resource'
3
+ require 'gogokit/resource/address'
4
+
5
+ module GogoKit
6
+ # @see http://developer.viagogo.net/#paymentmethod
7
+ class PaymentMethod < Resource
8
+ attr_accessor :id,
9
+ :details,
10
+ :type,
11
+ :type_description,
12
+ :buyer_method,
13
+ :default_buyer_method,
14
+ :seller_method,
15
+ :default_seller_method,
16
+ :billing_address
17
+ end
18
+
19
+ module PaymentMethodRepresenter
20
+ include Representable::JSON
21
+ include GogoKit::ResourceRepresenter
22
+
23
+ property :id
24
+ property :details
25
+ property :type
26
+ property :type_description
27
+ property :buyer_method
28
+ property :default_buyer_method
29
+ property :seller_method
30
+ property :default_seller_method
31
+ property :billing_address,
32
+ class: Address,
33
+ extend: AddressRepresenter,
34
+ embedded: true
35
+ end
36
+
37
+ module PaymentMethodsRepresenter
38
+ include Representable::JSON
39
+ include GogoKit::PagedResourceRepresenter
40
+
41
+ collection :items,
42
+ class: PaymentMethod,
43
+ extend: PaymentMethodRepresenter,
44
+ embedded: true
45
+ end
46
+ end
@@ -0,0 +1,91 @@
1
+ require 'gogokit/resource'
2
+ require 'gogokit/resource/event'
3
+ require 'gogokit/resource/venue'
4
+ require 'gogokit/resource/listing_note'
5
+ require 'gogokit/resource/split_type'
6
+ require 'gogokit/resource/ticket_type'
7
+ require 'gogokit/money'
8
+ require 'gogokit/seating'
9
+ require 'roar/coercion'
10
+
11
+ module GogoKit
12
+ # A set of tickets for sale on the viagogo marketplace
13
+ #
14
+ # @see http://viagogo.github.io/developer.viagogo.net/#sellerlisting
15
+ class SellerListing < Resource
16
+ attr_accessor :id,
17
+ :created_at,
18
+ :number_of_tickets,
19
+ :display_number_of_tickets,
20
+ :seating,
21
+ :face_value,
22
+ :ticket_price,
23
+ :ticket_proceeds,
24
+ :event,
25
+ :venue,
26
+ :ticket_type,
27
+ :split_type,
28
+ :listing_notes
29
+ end
30
+
31
+ module SellerListingRepresenter
32
+ include Representable::JSON
33
+ include GogoKit::ResourceRepresenter
34
+
35
+ property :id
36
+ property :created_at, type: DateTime
37
+ property :number_of_tickets
38
+ property :display_number_of_tickets
39
+ property :seating,
40
+ extend: GogoKit::SeatingRepresenter,
41
+ class: GogoKit::Seating,
42
+ skip_parse: ->(fragment, _) { fragment.nil? }
43
+ property :face_value,
44
+ extend: GogoKit::MoneyRepresenter,
45
+ class: GogoKit::Money,
46
+ skip_parse: ->(fragment, _) { fragment.nil? }
47
+ property :ticket_price,
48
+ extend: GogoKit::MoneyRepresenter,
49
+ class: GogoKit::Money,
50
+ skip_parse: ->(fragment, _) { fragment.nil? }
51
+ property :ticket_proceeds,
52
+ extend: GogoKit::MoneyRepresenter,
53
+ class: GogoKit::Money,
54
+ skip_parse: ->(fragment, _) { fragment.nil? }
55
+ property :event,
56
+ class: Event,
57
+ extend: EventRepresenter,
58
+ skip_parse: ->(fragment, _) { fragment.nil? },
59
+ embedded: true
60
+ property :venue,
61
+ class: Venue,
62
+ extend: VenueRepresenter,
63
+ skip_parse: ->(fragment, _) { fragment.nil? },
64
+ embedded: true
65
+ property :ticket_type,
66
+ extend: GogoKit::TicketTypeRepresenter,
67
+ class: GogoKit::TicketType,
68
+ skip_parse: ->(fragment, _) { fragment.nil? },
69
+ embedded: true
70
+ property :split_type,
71
+ extend: GogoKit::SplitTypeRepresenter,
72
+ class: GogoKit::SplitType,
73
+ skip_parse: ->(fragment, _) { fragment.nil? },
74
+ embedded: true
75
+ collection :listing_notes,
76
+ extend: GogoKit::ListingNoteRepresenter,
77
+ class: GogoKit::ListingNote,
78
+ skip_parse: ->(fragment, _) { fragment.nil? },
79
+ embedded: true
80
+ end
81
+
82
+ module SellerListingsRepresenter
83
+ include Representable::JSON
84
+ include GogoKit::PagedResourceRepresenter
85
+
86
+ collection :items,
87
+ class: SellerListing,
88
+ extend: SellerListingRepresenter,
89
+ embedded: true
90
+ end
91
+ end
@@ -0,0 +1,19 @@
1
+ require 'gogokit/resource'
2
+
3
+ module GogoKit
4
+ # @see http://viagogo.github.io/developer.viagogo.net/#splittype
5
+ class SplitType < Resource
6
+ attr_accessor :type,
7
+ :name,
8
+ :description
9
+ end
10
+
11
+ module SplitTypeRepresenter
12
+ include Representable::JSON
13
+ include GogoKit::ResourceRepresenter
14
+
15
+ property :type
16
+ property :name
17
+ property :description
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ require 'gogokit/resource'
2
+
3
+ module GogoKit
4
+ # @see http://developer.viagogo.net/#user
5
+ class User < Resource
6
+ attr_accessor :full_name,
7
+ :email,
8
+ :primary_phone,
9
+ :email_optin
10
+ end
11
+
12
+ module UserRepresenter
13
+ include Representable::JSON
14
+ include GogoKit::ResourceRepresenter
15
+
16
+ property :full_name
17
+ property :email
18
+ property :primary_phone
19
+ property :email_optin
20
+ end
21
+ end
@@ -0,0 +1,13 @@
1
+ require 'ostruct'
2
+ require 'representable/json'
3
+
4
+ module GogoKit
5
+ class Row < OpenStruct
6
+ end
7
+
8
+ module RowRepresenter
9
+ include Representable::JSON
10
+
11
+ property :name
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ require 'ostruct'
2
+ require 'representable/json'
3
+ require 'gogokit/row'
4
+
5
+ module GogoKit
6
+ class Section < OpenStruct
7
+ end
8
+
9
+ module SectionRepresenter
10
+ include Representable::JSON
11
+
12
+ property :name
13
+ property :free_text_row
14
+ collection :rows,
15
+ class: GogoKit::Row,
16
+ extend: GogoKit::RowRepresenter,
17
+ skip_parse: ->(fragment, _) { fragment.nil? }
18
+ end
19
+ end
@@ -5,7 +5,7 @@ module GogoKit
5
5
 
6
6
  # Current minor release.
7
7
  # @return [Integer]
8
- MINOR = 1
8
+ MINOR = 2
9
9
 
10
10
  # Current patch level.
11
11
  # @return [Integer]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gogokit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - viagogo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -93,6 +93,7 @@ files:
93
93
  - gogokit.gemspec
94
94
  - lib/gogokit.rb
95
95
  - lib/gogokit/client.rb
96
+ - lib/gogokit/client/address.rb
96
97
  - lib/gogokit/client/category.rb
97
98
  - lib/gogokit/client/country.rb
98
99
  - lib/gogokit/client/currency.rb
@@ -101,8 +102,11 @@ files:
101
102
  - lib/gogokit/client/listing.rb
102
103
  - lib/gogokit/client/metro_area.rb
103
104
  - lib/gogokit/client/oauth.rb
105
+ - lib/gogokit/client/payment_method.rb
104
106
  - lib/gogokit/client/root.rb
105
107
  - lib/gogokit/client/search.rb
108
+ - lib/gogokit/client/seller_listing.rb
109
+ - lib/gogokit/client/user.rb
106
110
  - lib/gogokit/client/venue.rb
107
111
  - lib/gogokit/configuration.rb
108
112
  - lib/gogokit/connection.rb
@@ -113,19 +117,27 @@ files:
113
117
  - lib/gogokit/oauth_token.rb
114
118
  - lib/gogokit/paged_resource.rb
115
119
  - lib/gogokit/resource.rb
120
+ - lib/gogokit/resource/address.rb
116
121
  - lib/gogokit/resource/category.rb
117
122
  - lib/gogokit/resource/country.rb
118
123
  - lib/gogokit/resource/currency.rb
119
124
  - lib/gogokit/resource/event.rb
120
125
  - lib/gogokit/resource/language.rb
121
126
  - lib/gogokit/resource/listing.rb
127
+ - lib/gogokit/resource/listing_constraints.rb
122
128
  - lib/gogokit/resource/listing_note.rb
123
129
  - lib/gogokit/resource/metro_area.rb
130
+ - lib/gogokit/resource/payment_method.rb
124
131
  - lib/gogokit/resource/root.rb
125
132
  - lib/gogokit/resource/search_result.rb
133
+ - lib/gogokit/resource/seller_listing.rb
134
+ - lib/gogokit/resource/split_type.rb
126
135
  - lib/gogokit/resource/ticket_type.rb
136
+ - lib/gogokit/resource/user.rb
127
137
  - lib/gogokit/resource/venue.rb
138
+ - lib/gogokit/row.rb
128
139
  - lib/gogokit/seating.rb
140
+ - lib/gogokit/section.rb
129
141
  - lib/gogokit/utils.rb
130
142
  - lib/gogokit/version.rb
131
143
  homepage: https://github.com/viagogo/gogokit.rb