Module: GogoKit::Client::SellerListing

Includes:
Utils
Included in:
GogoKit::Client
Defined in:
lib/gogokit/client/seller_listing.rb

Overview

GogoKit::Client methods for getting seller_listings

Instance Method Summary collapse

Methods included from Utils

#object_from_response

Instance Method Details

#create_seller_listing(event_id, options = {}) ⇒ GogoKit::SellerListing

Creates a listing for an event

Parameters:

  • event_id (Integer)

    The ID of the event

  • options (Hash) (defaults to: {})

    Optional options

Returns:



107
108
109
110
111
112
113
114
115
# File 'lib/gogokit/client/seller_listing.rb', line 107

def create_seller_listing(event_id, options = {})
  root = get_root
  object_from_response(GogoKit::SellerListing,
                       GogoKit::SellerListingRepresenter,
                       :post,
                       "#{root.links['self'].href}/events/" \
                       "#{event_id}/sellerlistings",
                       options)
end

#create_seller_listing_preview(event_id, options = {}) ⇒ GogoKit::SellerListing

Creates a preview of a listing for an event

Parameters:

  • event_id (Integer)

    The ID of the event

  • options (Hash) (defaults to: {})

    Optional options

Returns:



77
78
79
80
81
82
83
84
85
# File 'lib/gogokit/client/seller_listing.rb', line 77

def create_seller_listing_preview(event_id, options = {})
  root = get_root
  object_from_response(GogoKit::SellerListing,
                       GogoKit::SellerListingRepresenter,
                       :post,
                       "#{root.links['self'].href}/events/" \
                       "#{event_id}/sellerlistingpreview",
                       options)
end

#create_seller_listing_update_preview(listing_id, options = {}) ⇒ GogoKit::SellerListing

Creates a preview of an update to a listing

Parameters:

  • listing_id (Integer)

    The ID of the listing

  • options (Hash) (defaults to: {})

    Optional options

Returns:



92
93
94
95
96
97
98
99
100
# File 'lib/gogokit/client/seller_listing.rb', line 92

def create_seller_listing_update_preview(listing_id, options = {})
  root = get_root
  object_from_response(GogoKit::SellerListing,
                       GogoKit::SellerListingRepresenter,
                       :post,
                       "#{root.links['self'].href}/sellerlistings/" \
                       "#{listing_id}/updatepreview",
                       options)
end

#delete_seller_listing(listing_id, options = {}) ⇒ Hash

Deletes a listing

Parameters:

  • listing_id (Integer)

    The ID of the listing

  • options (Hash) (defaults to: {})

    Optional options

Returns:

  • (Hash)

    object containing response information



137
138
139
140
141
# File 'lib/gogokit/client/seller_listing.rb', line 137

def delete_seller_listing(listing_id, options = {})
  root = get_root
  delete("#{root.links['self'].href}/sellerlistings/#{listing_id}",
         options)
end

#get_listing_constraints(listing_id, options = {}) ⇒ GogoKit::ListingConstraints

Retrieves the constraints for updating a listing

listing

Parameters:

  • listing_id (Integer)

    The ID of the listing

  • options (Hash) (defaults to: {})

    Optional options

Returns:



62
63
64
65
66
67
68
69
70
# File 'lib/gogokit/client/seller_listing.rb', line 62

def get_listing_constraints(listing_id, options = {})
  root = get_root
  object_from_response(GogoKit::ListingConstraints,
                       GogoKit::ListingConstraintsRepresenter,
                       :get,
                       "#{root.links['self'].href}/sellerlistings/" \
                       "#{listing_id}/constraints",
                       options)
end

#get_listing_constraints_for_event(event_id, options = {}) ⇒ GogoKit::ListingConstraints

Retrieves the constraints for creating a listing for an event

listing for an event

Parameters:

  • event_id (Integer)

    The ID of the event

  • options (Hash) (defaults to: {})

    Optional options

Returns:



46
47
48
49
50
51
52
53
54
# File 'lib/gogokit/client/seller_listing.rb', line 46

def get_listing_constraints_for_event(event_id, options = {})
  root = get_root
  object_from_response(GogoKit::ListingConstraints,
                       GogoKit::ListingConstraintsRepresenter,
                       :get,
                       "#{root.links['self'].href}/events/#{event_id}" \
                       '/listingconstraints',
                       options)
end

#get_seller_listing(listing_id, options = {}) ⇒ GogoKit::SellerListing

Retrieves a listing by ID

Parameters:

  • listing_id (Integer)

    The ID of the listing to be retrieved

  • options (Hash) (defaults to: {})

    Optional options

Returns:



16
17
18
19
20
21
22
23
24
# File 'lib/gogokit/client/seller_listing.rb', line 16

def get_seller_listing(listing_id, options = {})
  root = get_root
  object_from_response(GogoKit::SellerListing,
                       GogoKit::SellerListingRepresenter,
                       :get,
                       "#{root.links['self'].href}/sellerlistings/" \
                       "#{listing_id}",
                       options)
end

#get_seller_listings(options = {}) ⇒ GogoKit::PagedResource

Retrieves all listings for the authenticated user

Parameters:

  • options (Hash) (defaults to: {})

    Optional options

Returns:

See Also:



31
32
33
34
35
36
37
38
# File 'lib/gogokit/client/seller_listing.rb', line 31

def get_seller_listings(options = {})
  root = get_root
  object_from_response(GogoKit::PagedResource,
                       GogoKit::SellerListingsRepresenter,
                       :get,
                       "#{root.links['self'].href}/sellerlistings",
                       options)
end

#update_seller_listing(listing_id, options = {}) ⇒ GogoKit::SellerListing

Updates an existing listing

Parameters:

  • listing_id (Integer)

    The ID of the listing

  • options (Hash) (defaults to: {})

    Optional options

Returns:



122
123
124
125
126
127
128
129
130
# File 'lib/gogokit/client/seller_listing.rb', line 122

def update_seller_listing(listing_id, options = {})
  root = get_root
  object_from_response(GogoKit::SellerListing,
                       GogoKit::SellerListingRepresenter,
                       :patch,
                       "#{root.links['self'].href}/sellerlistings/" \
                       "#{listing_id}",
                       options)
end