Class: ShopifyAPI::Clients::Rest::Admin

Inherits:
HttpClient
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/clients/rest/admin.rb

Constant Summary

Constants inherited from HttpClient

HttpClient::RETRY_WAIT_TIME

Instance Method Summary collapse

Methods inherited from HttpClient

#request

Constructor Details

#initialize(session: nil) ⇒ Admin

Returns a new instance of Admin.



11
12
13
# File 'lib/shopify_api/clients/rest/admin.rb', line 11

def initialize(session: nil)
  super(session: session, base_path: "/admin/api/#{Context.api_version}")
end

Instance Method Details

#delete(path:, body: nil, query: nil, headers: nil, tries: 1) ⇒ Object



40
41
42
43
44
45
# File 'lib/shopify_api/clients/rest/admin.rb', line 40

def delete(path:, body: nil, query: nil, headers: nil, tries: 1)
  request(
    make_request(http_method: :delete, path: path, body: body, query: query, headers: headers,
      tries: T.must(tries)),
  )
end

#get(path:, body: nil, query: nil, headers: nil, tries: 1) ⇒ Object



24
25
26
27
28
29
# File 'lib/shopify_api/clients/rest/admin.rb', line 24

def get(path:, body: nil, query: nil, headers: nil, tries: 1)
  request(
    make_request(http_method: :get, path: path, body: body, query: query, headers: headers,
      tries: T.must(tries)),
  )
end

#post(path:, body:, query: nil, headers: nil, tries: 1) ⇒ Object



72
73
74
75
76
77
# File 'lib/shopify_api/clients/rest/admin.rb', line 72

def post(path:, body:, query: nil, headers: nil, tries: 1)
  request(
    make_request(http_method: :post, path: path, body: body, query: query, headers: headers,
      tries: T.must(tries)),
  )
end

#put(path:, body:, query: nil, headers: nil, tries: 1) ⇒ Object



56
57
58
59
60
61
# File 'lib/shopify_api/clients/rest/admin.rb', line 56

def put(path:, body:, query: nil, headers: nil, tries: 1)
  request(
    make_request(http_method: :put, path: path, body: body, query: query, headers: headers,
      tries: T.must(tries)),
  )
end