Class: ColorMeShop::CustomerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/color_me_shop/api/customer_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomerApi

Returns a new instance of CustomerApi.



19
20
21
# File 'lib/color_me_shop/api/customer_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/color_me_shop/api/customer_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_customer(customer_id, opts = {}) ⇒ Object

顧客データの取得

Parameters:

  • customer_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


26
27
28
29
# File 'lib/color_me_shop/api/customer_api.rb', line 26

def get_customer(customer_id, opts = {})
  data, _status_code, _headers = get_customer_with_http_info(customer_id, opts)
  data
end

#get_customer_with_http_info(customer_id, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

顧客データの取得

Parameters:

  • customer_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/color_me_shop/api/customer_api.rb', line 35

def get_customer_with_http_info(customer_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...'
  end
  # verify the required parameter 'customer_id' is set
  if @api_client.config.client_side_validation && customer_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_id' when calling CustomerApi.get_customer"
  end
  # resource path
  local_var_path = '/v1/customers/{customerId}.json'.sub('{' + 'customerId' + '}', customer_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customers(opts = {}) ⇒ Object

顧客データのリストを取得

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    顧客IDで検索。カンマ区切りで複数指定可能

  • :name (String)

    顧客名で部分一致検索

  • :furigana (String)

    顧客フリガナがで部分一致検索

  • :mail (String)

    顧客メールアドレスで部分一致検索

  • :postal (String)

    顧客の郵便番号で部分一致検索

  • :tel (String)

    顧客の電話番号で部分一致検索

  • :mobile (BOOLEAN)

    &#x60;true&#x60;なら会員登録済みの顧客から検索

  • :make_date_min (String)

    指定日時以降に登録された顧客から検索

  • :make_date_max (String)

    指定日時以前に登録された顧客から検索

  • :update_date_min (String)

    指定日時以降に更新された顧客から検索

  • :update_date_max (String)

    指定日時以降に更新された顧客から検索

Returns:

  • (Object)


86
87
88
89
# File 'lib/color_me_shop/api/customer_api.rb', line 86

def get_customers(opts = {})
  data, _status_code, _headers = get_customers_with_http_info(opts)
  data
end

#get_customers_with_http_info(opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

顧客データのリストを取得

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :ids (String)

    顧客IDで検索。カンマ区切りで複数指定可能

  • :name (String)

    顧客名で部分一致検索

  • :furigana (String)

    顧客フリガナがで部分一致検索

  • :mail (String)

    顧客メールアドレスで部分一致検索

  • :postal (String)

    顧客の郵便番号で部分一致検索

  • :tel (String)

    顧客の電話番号で部分一致検索

  • :mobile (BOOLEAN)

    &#x60;true&#x60;なら会員登録済みの顧客から検索

  • :make_date_min (String)

    指定日時以降に登録された顧客から検索

  • :make_date_max (String)

    指定日時以前に登録された顧客から検索

  • :update_date_min (String)

    指定日時以降に更新された顧客から検索

  • :update_date_max (String)

    指定日時以降に更新された顧客から検索

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/color_me_shop/api/customer_api.rb', line 105

def get_customers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.get_customers ...'
  end
  # resource path
  local_var_path = '/v1/customers.json'

  # query parameters
  query_params = {}
  query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'furigana'] = opts[:'furigana'] if !opts[:'furigana'].nil?
  query_params[:'mail'] = opts[:'mail'] if !opts[:'mail'].nil?
  query_params[:'postal'] = opts[:'postal'] if !opts[:'postal'].nil?
  query_params[:'tel'] = opts[:'tel'] if !opts[:'tel'].nil?
  query_params[:'mobile'] = opts[:'mobile'] if !opts[:'mobile'].nil?
  query_params[:'make_date_min'] = opts[:'make_date_min'] if !opts[:'make_date_min'].nil?
  query_params[:'make_date_max'] = opts[:'make_date_max'] if !opts[:'make_date_max'].nil?
  query_params[:'update_date_min'] = opts[:'update_date_min'] if !opts[:'update_date_min'].nil?
  query_params[:'update_date_max'] = opts[:'update_date_max'] if !opts[:'update_date_max'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#get_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#post_customers(unknown_base_type, opts = {}) ⇒ Object

顧客データを追加

Parameters:

  • unknown_base_type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


155
156
157
158
# File 'lib/color_me_shop/api/customer_api.rb', line 155

def post_customers(unknown_base_type, opts = {})
  data, _status_code, _headers = post_customers_with_http_info(unknown_base_type, opts)
  data
end

#post_customers_with_http_info(unknown_base_type, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

顧客データを追加

Parameters:

  • unknown_base_type
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/color_me_shop/api/customer_api.rb', line 164

def post_customers_with_http_info(unknown_base_type, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: CustomerApi.post_customers ...'
  end
  # verify the required parameter 'unknown_base_type' is set
  if @api_client.config.client_side_validation && unknown_base_type.nil?
    fail ArgumentError, "Missing the required parameter 'unknown_base_type' when calling CustomerApi.post_customers"
  end
  # resource path
  local_var_path = '/v1/customers.json'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(unknown_base_type)
  auth_names = ['OAuth2']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: CustomerApi#post_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end