Class: ShopifyAPI::Comment
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::Comment
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/comment.rb,
lib/shopify_api/rest/resources/2022_07/comment.rb,
lib/shopify_api/rest/resources/2022_10/comment.rb,
lib/shopify_api/rest/resources/2023_01/comment.rb,
lib/shopify_api/rest/resources/2023_04/comment.rb,
lib/shopify_api/rest/resources/2023_07/comment.rb,
lib/shopify_api/rest/resources/2023_10/comment.rb,
lib/shopify_api/rest/resources/2024_01/comment.rb,
lib/shopify_api/rest/resources/2024_04/comment.rb,
lib/shopify_api/rest/resources/2024_07/comment.rb,
lib/shopify_api/rest/resources/2024_10/comment.rb
Instance Attribute Summary collapse
-
#article_id ⇒ Object
readonly
Returns the value of attribute article_id.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#blog_id ⇒ Object
readonly
Returns the value of attribute blog_id.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#body_html ⇒ Object
readonly
Returns the value of attribute body_html.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#published_at ⇒ Object
readonly
Returns the value of attribute published_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, fields: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .count(created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
- #approve(body: nil, **kwargs) ⇒ Object
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Comment
constructor
A new instance of Comment.
- #not_spam(body: nil, **kwargs) ⇒ Object
- #remove(body: nil, **kwargs) ⇒ Object
- #restore(body: nil, **kwargs) ⇒ Object
- #spam(body: nil, **kwargs) ⇒ Object
Methods inherited from Rest::Base
api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_body_name, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Comment
Returns a new instance of Comment.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 19 def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) @article_id = T.let(nil, T.nilable(Integer)) @author = T.let(nil, T.nilable(String)) @blog_id = T.let(nil, T.nilable(Integer)) @body = T.let(nil, T.nilable(String)) @body_html = T.let(nil, T.nilable(String)) @created_at = T.let(nil, T.nilable(String)) @email = T.let(nil, T.nilable(String)) @id = T.let(nil, T.nilable(Integer)) @ip = T.let(nil, T.nilable(String)) @published_at = T.let(nil, T.nilable(String)) @status = T.let(nil, T.nilable(String)) @updated_at = T.let(nil, T.nilable(String)) @user_agent = T.let(nil, T.nilable(String)) super(session: session, from_hash: from_hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#article_id ⇒ Object (readonly)
Returns the value of attribute article_id.
54 55 56 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 54 def article_id @article_id end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
56 57 58 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 56 def @author end |
#blog_id ⇒ Object (readonly)
Returns the value of attribute blog_id.
58 59 60 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 58 def blog_id @blog_id end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
60 61 62 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 60 def body @body end |
#body_html ⇒ Object (readonly)
Returns the value of attribute body_html.
62 63 64 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 62 def body_html @body_html end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
64 65 66 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 64 def created_at @created_at end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
66 67 68 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 66 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
68 69 70 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 68 def id @id end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
70 71 72 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 70 def ip @ip end |
#published_at ⇒ Object (readonly)
Returns the value of attribute published_at.
72 73 74 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 72 def published_at @published_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
74 75 76 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 74 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
76 77 78 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 76 def updated_at @updated_at end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
78 79 80 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 78 def user_agent @user_agent end |
Class Method Details
.all(limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, fields: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 118 def all( limit: nil, since_id: nil, created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, fields: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {}, params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, fields: fields, published_status: published_status, status: status}.merge(kwargs).compact, ) T.cast(response, T::Array[Comment]) end |
.count(created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 156 def count( created_at_min: nil, created_at_max: nil, updated_at_min: nil, updated_at_max: nil, published_at_min: nil, published_at_max: nil, published_status: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :count, session: session, ids: {}, params: {created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status, status: status}.merge(kwargs).compact, body: {}, entity: nil, ) end |
.find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 88 def find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id}, params: {fields: fields}, ) T.cast(result[0], T.nilable(Comment)) end |
Instance Method Details
#approve(body: nil, **kwargs) ⇒ Object
187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 187 def approve( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :approve, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |
#not_spam(body: nil, **kwargs) ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 208 def not_spam( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :not_spam, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |
#remove(body: nil, **kwargs) ⇒ Object
229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 229 def remove( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :remove, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |
#restore(body: nil, **kwargs) ⇒ Object
250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 250 def restore( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :restore, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |
#spam(body: nil, **kwargs) ⇒ Object
271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/shopify_api/rest/resources/2022_04/comment.rb', line 271 def spam( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :spam, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |