Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 2024-07 API version #1325

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
Note: For changes to the API, see https://shopify.dev/changelog?filter=api

## Unreleased

- [#1320](https://github.com/Shopify/shopify-api-ruby/pull/1320) Fix sorbet type on Shop.tax_shipping field
- [#1325](https://github.com/Shopify/shopify-api-ruby/pull/1325) Add support for 2024-07 API version

## 14.3.0

- [#1312](https://github.com/Shopify/shopify-api-ruby/pull/1312) Use same leeway for `exp` and `nbf` when parsing JWT
- [#1313](https://github.com/Shopify/shopify-api-ruby/pull/1313) Fix: Webhook Registry now working with response_as_struct enabled
- [#1314](https://github.com/Shopify/shopify-api-ruby/pull/1314)
Expand All @@ -17,9 +20,11 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
- `expires_at` alias for `exp` - returns the expiration time

## 14.2.0

- [#1309](https://github.com/Shopify/shopify-api-ruby/pull/1309) Add `Session#copy_attributes_from` method

## 14.1.0

- [#1071](https://github.com/Shopify/shopify-api-ruby/issues/1071) Fix FulfillmentEvent class types
- Fix: InventoryItem class `harmonized_system_code` attribute type which can be either integer, string or nil
- Fix: Variant class `inventory_quantity` attribute type which can be either integer, string or nil
Expand All @@ -28,17 +33,20 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
- [1305](https://github.com/Shopify/shopify-api-ruby/pull/1305/) Adds support for the `2024-04` API version.

## 14.0.1

- [#1288](https://github.com/Shopify/shopify-api-ruby/pull/1288) Fix FeatureDeprecatedError being raised without a message.
- [1290](https://github.com/Shopify/shopify-api-ruby/pull/1290) Move deprecation of `ShopifyAPI::Webhooks::Handler#handle` to version 15.0.0

## 14.0.0

- [#1274](https://github.com/Shopify/shopify-api-ruby/pull/1274) ⚠️ [Breaking] Update sorbet and rbi dependencies. Remove support for ruby 2.7. Minimum required Ruby version is 3.0
- [#1282](https://github.com/Shopify/shopify-api-ruby/pull/1282) Fixes a bug where diffing attributes to update not take into account of Array changes and required ids.
- [#1254](https://github.com/Shopify/shopify-api-ruby/pull/1254) Introduce token exchange API for fetching access tokens. This feature is currently unstable and cannot be used yet.
- [#1268](https://github.com/Shopify/shopify-api-ruby/pull/1268) Add [new webhook handler interface](https://github.com/Shopify/shopify-api-ruby/blob/main/docs/usage/webhooks.md#create-a-webhook-handler) to provide `webhook_id ` and `api_version` information to webhook handlers.
- [#1275](https://github.com/Shopify/shopify-api-ruby/pull/1275) Allow adding custom headers in REST Resource HTTP calls.

## 13.4.0

- [#1210](https://github.com/Shopify/shopify-api-ruby/pull/1246) Add context option `response_as_struct` to allow GraphQL API responses to be accessed via dot notation.
- [#1257](https://github.com/Shopify/shopify-api-ruby/pull/1257) Add `api_call_limit` and `retry_request_after` to REST resources to expose rate limit information.
- [#1257](https://github.com/Shopify/shopify-api-ruby/pull/1257) Added support for the 2024-01 API version. This also includes a fix for the `for_hash` option when creating resources.
Expand Down
3 changes: 2 additions & 1 deletion lib/shopify_api/admin_versions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module ShopifyAPI
module AdminVersions
SUPPORTED_ADMIN_VERSIONS = T.let([
"unstable",
"2024-07",
"2024-04",
"2024-01",
"2023-10",
Expand All @@ -17,7 +18,7 @@ module AdminVersions
"2022-01",
], T::Array[String])

LATEST_SUPPORTED_ADMIN_VERSION = T.let("2024-04", String)
LATEST_SUPPORTED_ADMIN_VERSION = T.let("2024-07", String)
end

SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
Expand Down
194 changes: 194 additions & 0 deletions lib/shopify_api/rest/resources/2024_07/abandoned_checkout.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# typed: false
# frozen_string_literal: true

########################################################################################################################
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
########################################################################################################################

module ShopifyAPI
class AbandonedCheckout < ShopifyAPI::Rest::Base
extend T::Sig

@prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
@next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)

@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)

sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

@abandoned_checkout_url = T.let(nil, T.nilable(String))
@billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
@buyer_accepts_marketing = T.let(nil, T.nilable(T::Boolean))
@buyer_accepts_sms_marketing = T.let(nil, T.nilable(T::Boolean))
@cart_token = T.let(nil, T.nilable(String))
@closed_at = T.let(nil, T.nilable(String))
@completed_at = T.let(nil, T.nilable(String))
@created_at = T.let(nil, T.nilable(String))
@currency = T.let(nil, T.nilable(Currency))
@customer = T.let(nil, T.nilable(Customer))
@customer_locale = T.let(nil, T.nilable(String))
@device_id = T.let(nil, T.nilable(Integer))
@discount_codes = T.let(nil, T.nilable(T::Array[T.untyped]))
@email = T.let(nil, T.nilable(String))
@gateway = T.let(nil, T.nilable(String))
@id = T.let(nil, T.nilable(Integer))
@landing_site = T.let(nil, T.nilable(String))
@line_items = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
@location_id = T.let(nil, T.nilable(Integer))
@note = T.let(nil, T.nilable(String))
@phone = T.let(nil, T.nilable(String))
@presentment_currency = T.let(nil, T.nilable(String))
@referring_site = T.let(nil, T.nilable(String))
@shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
@shipping_lines = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
@sms_marketing_phone = T.let(nil, T.nilable(String))
@source_name = T.let(nil, T.nilable(String))
@subtotal_price = T.let(nil, T.nilable(String))
@tax_lines = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
@taxes_included = T.let(nil, T.nilable(T::Boolean))
@token = T.let(nil, T.nilable(String))
@total_discounts = T.let(nil, T.nilable(String))
@total_duties = T.let(nil, T.nilable(String))
@total_line_items_price = T.let(nil, T.nilable(String))
@total_price = T.let(nil, T.nilable(String))
@total_tax = T.let(nil, T.nilable(String))
@total_weight = T.let(nil, T.nilable(Integer))
@updated_at = T.let(nil, T.nilable(String))
@user_id = T.let(nil, T.nilable(Integer))

super(session: session, from_hash: from_hash)
end

@has_one = T.let({
currency: Currency,
customer: Customer
}, T::Hash[Symbol, Class])
@has_many = T.let({
discount_codes: DiscountCode
}, T::Hash[Symbol, Class])
@paths = T.let([
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"},
{http_method: :get, operation: :checkouts, ids: [], path: "checkouts.json"}
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])

sig { returns(T.nilable(String)) }
attr_reader :abandoned_checkout_url
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
attr_reader :billing_address
sig { returns(T.nilable(T::Boolean)) }
attr_reader :buyer_accepts_marketing
sig { returns(T.nilable(T::Boolean)) }
attr_reader :buyer_accepts_sms_marketing
sig { returns(T.nilable(String)) }
attr_reader :cart_token
sig { returns(T.nilable(String)) }
attr_reader :closed_at
sig { returns(T.nilable(String)) }
attr_reader :completed_at
sig { returns(T.nilable(String)) }
attr_reader :created_at
sig { returns(T.nilable(Currency)) }
attr_reader :currency
sig { returns(T.nilable(Customer)) }
attr_reader :customer
sig { returns(T.nilable(String)) }
attr_reader :customer_locale
sig { returns(T.nilable(Integer)) }
attr_reader :device_id
sig { returns(T.nilable(T::Array[DiscountCode])) }
attr_reader :discount_codes
sig { returns(T.nilable(String)) }
attr_reader :email
sig { returns(T.nilable(String)) }
attr_reader :gateway
sig { returns(T.nilable(Integer)) }
attr_reader :id
sig { returns(T.nilable(String)) }
attr_reader :landing_site
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
attr_reader :line_items
sig { returns(T.nilable(Integer)) }
attr_reader :location_id
sig { returns(T.nilable(String)) }
attr_reader :note
sig { returns(T.nilable(String)) }
attr_reader :phone
sig { returns(T.nilable(String)) }
attr_reader :presentment_currency
sig { returns(T.nilable(String)) }
attr_reader :referring_site
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
attr_reader :shipping_address
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
attr_reader :shipping_lines
sig { returns(T.nilable(String)) }
attr_reader :sms_marketing_phone
sig { returns(T.nilable(String)) }
attr_reader :source_name
sig { returns(T.nilable(String)) }
attr_reader :subtotal_price
sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
attr_reader :tax_lines
sig { returns(T.nilable(T::Boolean)) }
attr_reader :taxes_included
sig { returns(T.nilable(String)) }
attr_reader :token
sig { returns(T.nilable(String)) }
attr_reader :total_discounts
sig { returns(T.nilable(String)) }
attr_reader :total_duties
sig { returns(T.nilable(String)) }
attr_reader :total_line_items_price
sig { returns(T.nilable(String)) }
attr_reader :total_price
sig { returns(T.nilable(String)) }
attr_reader :total_tax
sig { returns(T.nilable(Integer)) }
attr_reader :total_weight
sig { returns(T.nilable(String)) }
attr_reader :updated_at
sig { returns(T.nilable(Integer)) }
attr_reader :user_id

class << self
sig do
params(
since_id: T.untyped,
created_at_min: T.untyped,
created_at_max: T.untyped,
updated_at_min: T.untyped,
updated_at_max: T.untyped,
status: T.untyped,
limit: T.untyped,
session: Auth::Session,
kwargs: T.untyped
).returns(T.untyped)
end
def checkouts(
since_id: nil,
created_at_min: nil,
created_at_max: nil,
updated_at_min: nil,
updated_at_max: nil,
status: nil,
limit: nil,
session: ShopifyAPI::Context.active_session,
**kwargs
)
request(
http_method: :get,
operation: :checkouts,
session: session,
ids: {},
params: {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, status: status, limit: limit}.merge(kwargs).compact,
body: {},
entity: nil,
)
end

end

end
end
62 changes: 62 additions & 0 deletions lib/shopify_api/rest/resources/2024_07/access_scope.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# typed: false
# frozen_string_literal: true

########################################################################################################################
# This file is auto-generated. If you have an issue, please create a GitHub issue. #
########################################################################################################################

module ShopifyAPI
class AccessScope < ShopifyAPI::Rest::Base
extend T::Sig

@prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
@next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)

@api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
@retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)

sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

@handle = T.let(nil, T.nilable(String))
@access_scopes = T.let(nil, T.nilable(T::Array[T.untyped]))

super(session: session, from_hash: from_hash)
end

@has_one = T.let({}, T::Hash[Symbol, Class])
@has_many = T.let({}, T::Hash[Symbol, Class])
@custom_prefix = T.let("/admin/oauth", T.nilable(String))
@paths = T.let([
{http_method: :get, operation: :get, ids: [], path: "access_scopes.json"}
], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])

sig { returns(T.nilable(String)) }
attr_reader :handle
sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
attr_reader :access_scopes

class << self
sig do
params(
session: Auth::Session,
kwargs: T.untyped
).returns(T::Array[AccessScope])
end
def all(
session: ShopifyAPI::Context.active_session,
**kwargs
)
response = base_find(
session: session,
ids: {},
params: {}.merge(kwargs).compact,
)

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

end

end
end
Loading
Loading