Class: ShopifyAPI::OrderRisk

Inherits:
Rest::Base show all
Extended by:
T::Sig
Defined in:
lib/shopify_api/rest/resources/2021_07/order_risk.rb,
lib/shopify_api/rest/resources/2021_10/order_risk.rb,
lib/shopify_api/rest/resources/2022_01/order_risk.rb,
lib/shopify_api/rest/resources/2022_04/order_risk.rb

Instance Attribute Summary collapse

Attributes inherited from Rest::Base

#errors, #original_state

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Rest::Base

base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, has_many?, has_one?, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, #save, #save!, #to_hash

Constructor Details

#initialize(session: ShopifyAPI::Context.active_session) ⇒ OrderRisk

Returns a new instance of OrderRisk.


12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 12

def initialize(session: ShopifyAPI::Context.active_session)
  super(session: session)

  @cause_cancel = T.let(nil, T.nilable(T::Boolean))
  @checkout_id = T.let(nil, T.nilable(Integer))
  @display = T.let(nil, T.nilable(T::Boolean))
  @id = T.let(nil, T.nilable(Integer))
  @merchant_message = T.let(nil, T.nilable(String))
  @message = T.let(nil, T.nilable(String))
  @order_id = T.let(nil, T.nilable(Integer))
  @recommendation = T.let(nil, T.nilable(String))
  @score = T.let(nil, T.nilable(Float))
  @source = T.let(nil, T.nilable(String))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base

Instance Attribute Details

#cause_cancelObject (readonly)

Returns the value of attribute cause_cancel.


38
39
40
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 38

def cause_cancel
  @cause_cancel
end

#checkout_idObject (readonly)

Returns the value of attribute checkout_id.


40
41
42
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 40

def checkout_id
  @checkout_id
end

#displayObject (readonly)

Returns the value of attribute display.


42
43
44
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 42

def display
  @display
end

#idObject (readonly)

Returns the value of attribute id.


44
45
46
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 44

def id
  @id
end

#merchant_messageObject (readonly)

Returns the value of attribute merchant_message.


46
47
48
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 46

def merchant_message
  @merchant_message
end

#messageObject (readonly)

Returns the value of attribute message.


48
49
50
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 48

def message
  @message
end

#order_idObject (readonly)

Returns the value of attribute order_id.


50
51
52
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 50

def order_id
  @order_id
end

#recommendationObject (readonly)

Returns the value of attribute recommendation.


52
53
54
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 52

def recommendation
  @recommendation
end

#scoreObject (readonly)

Returns the value of attribute score.


54
55
56
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 54

def score
  @score
end

#sourceObject (readonly)

Returns the value of attribute source.


56
57
58
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 56

def source
  @source
end

Class Method Details

.all(order_id: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object


114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 114

def all(
  order_id: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {order_id: order_id},
    params: {}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[OrderRisk])
end

.delete(id:, order_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object


93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 93

def delete(
  id:,
  order_id: nil,
  session: ShopifyAPI::Context.active_session
)
  request(
    http_method: :delete,
    operation: :delete,
    session: session,
    ids: {id: id, order_id: order_id},
    params: {},
  )
end

.find(id:, order_id: nil, session: ShopifyAPI::Context.active_session) ⇒ Object


73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 73

def find(
  id:,
  order_id: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id, order_id: order_id},
    params: {},
  )
  T.cast(result[0], T.nilable(OrderRisk))
end

.json_body_nameObject


62
63
64
# File 'lib/shopify_api/rest/resources/2021_07/order_risk.rb', line 62

def json_body_name()
  "risk"
end