lib/platform-api/client.rb in platform-api-3.6.0 vs lib/platform-api/client.rb in platform-api-3.7.0

- old
+ new

@@ -81,11 +81,11 @@ final_options end # Get the default options. def self.default_options - default_headers = {"Accept"=>"application/vnd.heroku+json; version=3", "User-Agent"=>"platform-api/3.6.0"} + default_headers = {"Accept"=>"application/vnd.heroku+json; version=3", "User-Agent"=>"platform-api/3.7.0"} { default_headers: default_headers, url: "https://api.heroku.com" } end @@ -96,10 +96,17 @@ class Client def initialize(client) @client = client end + # A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + # + # @return [AccountDelinquency] + def account_delinquency + @account_delinquency_resource ||= AccountDelinquency.new(@client) + end + # An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. # # @return [AccountFeature] def account_feature @account_feature_resource ||= AccountFeature.new(@client) @@ -348,11 +355,11 @@ # @return [Formation] def formation @formation_resource ||= Formation.new(@client) end - # Identity Providers represent the SAML configuration of an Enterprise Account or Team. + # Identity Providers represent the SAML configuration of teams or an Enterprise account # # @return [IdentityProvider] def identity_provider @identity_provider_resource ||= IdentityProvider.new(@client) end @@ -677,10 +684,17 @@ # @return [TeamDailyUsage] def team_daily_usage @team_daily_usage_resource ||= TeamDailyUsage.new(@client) end + # A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + # + # @return [TeamDelinquency] + def team_delinquency + @team_delinquency_resource ||= TeamDelinquency.new(@client) + end + # A team feature represents a feature enabled on a team account. # # @return [TeamFeature] def team_feature @team_feature_resource ||= TeamFeature.new(@client) @@ -771,10 +785,22 @@ end end private + # A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid. + class AccountDelinquency + def initialize(client) + @client = client + end + + # Account delinquency information. + def info() + @client.account_delinquency.info() + end + end + # An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku. class AccountFeature def initialize(client) @client = client end @@ -1463,22 +1489,22 @@ @client = client end # Get archive for a single month. # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param archive_year: year of the archive # @param archive_month: month of the archive - def info(enterprise_account_id, archive_year, archive_month) - @client.archive.info(enterprise_account_id, archive_year, archive_month) + def info(enterprise_account_id_or_enterprise_account_name, archive_year, archive_month) + @client.archive.info(enterprise_account_id_or_enterprise_account_name, archive_year, archive_month) end # List existing archives. # - # @param enterprise_account_id: unique identifier of the enterprise account - def list(enterprise_account_id) - @client.archive.list(enterprise_account_id) + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account + def list(enterprise_account_id_or_enterprise_account_name) + @client.archive.list(enterprise_account_id_or_enterprise_account_name) end end # An audit trail event represents some action on the platform class AuditTrailEvent @@ -1486,13 +1512,13 @@ @client = client end # List existing events. Returns all events for one day, defaulting to current day. Order, actor, action, and type, and day query params can be specified as query parameters. For example, '/enterprise-accounts/:id/events?order=desc&actor=user@example.com&action=create&type=app&day=2020-09-30' would return events in descending order and only return app created events by the user with user@example.com email address. # - # @param enterprise_account_id: unique identifier of the enterprise account - def list(enterprise_account_id) - @client.audit_trail_event.list(enterprise_account_id) + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account + def list(enterprise_account_id_or_enterprise_account_name) + @client.audit_trail_event.list(enterprise_account_id_or_enterprise_account_name) end end # A build represents the process of transforming a code tarball into a slug class Build @@ -1796,38 +1822,38 @@ @client = client end # List members in an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account - def list(enterprise_account_id) - @client.enterprise_account_member.list(enterprise_account_id) + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account + def list(enterprise_account_id_or_enterprise_account_name) + @client.enterprise_account_member.list(enterprise_account_id_or_enterprise_account_name) end # Create a member in an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param body: the object to pass as the request payload - def create(enterprise_account_id, body = {}) - @client.enterprise_account_member.create(enterprise_account_id, body) + def create(enterprise_account_id_or_enterprise_account_name, body = {}) + @client.enterprise_account_member.create(enterprise_account_id_or_enterprise_account_name, body) end # Update a member in an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param account_email_or_account_id: unique email address of account or unique identifier of an account # @param body: the object to pass as the request payload - def update(enterprise_account_id, account_email_or_account_id, body = {}) - @client.enterprise_account_member.update(enterprise_account_id, account_email_or_account_id, body) + def update(enterprise_account_id_or_enterprise_account_name, account_email_or_account_id, body = {}) + @client.enterprise_account_member.update(enterprise_account_id_or_enterprise_account_name, account_email_or_account_id, body) end # delete a member in an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param account_email_or_account_id: unique email address of account or unique identifier of an account - def delete(enterprise_account_id, account_email_or_account_id) - @client.enterprise_account_member.delete(enterprise_account_id, account_email_or_account_id) + def delete(enterprise_account_id_or_enterprise_account_name, account_email_or_account_id) + @client.enterprise_account_member.delete(enterprise_account_id_or_enterprise_account_name, account_email_or_account_id) end end # Usage for an enterprise account at a monthly resolution. class EnterpriseAccountMonthlyUsage @@ -1856,21 +1882,21 @@ @client.enterprise_account.list() end # Information about an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account - def info(enterprise_account_id) - @client.enterprise_account.info(enterprise_account_id) + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account + def info(enterprise_account_id_or_enterprise_account_name) + @client.enterprise_account.info(enterprise_account_id_or_enterprise_account_name) end # Update enterprise account properties # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param body: the object to pass as the request payload - def update(enterprise_account_id, body = {}) - @client.enterprise_account.update(enterprise_account_id, body) + def update(enterprise_account_id_or_enterprise_account_name, body = {}) + @client.enterprise_account.update(enterprise_account_id_or_enterprise_account_name, body) end end # Filters are special endpoints to allow for API consumers to specify a subset of resources to consume in order to reduce the number of requests that are performed. Each filter endpoint endpoint is responsible for determining its supported request format. The endpoints are over POST in order to handle large request bodies without hitting request uri query length limitations, but the requests themselves are idempotent and will not have side effects. class FilterApps @@ -1923,11 +1949,11 @@ def update(app_id_or_app_name, formation_id_or_formation_type, body = {}) @client.formation.update(app_id_or_app_name, formation_id_or_formation_type, body) end end - # Identity Providers represent the SAML configuration of an Enterprise Account or Team. + # Identity Providers represent the SAML configuration of teams or an Enterprise account class IdentityProvider def initialize(client) @client = client end @@ -2185,11 +2211,11 @@ # @param oauth_client_id: unique identifier of this OAuth client def delete(oauth_client_id) @client.oauth_client.delete(oauth_client_id) end - # Info for an OAuth client + # Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter. # # @param oauth_client_id: unique identifier of this OAuth client def info(oauth_client_id) @client.oauth_client.info(oauth_client_id) end @@ -3061,38 +3087,38 @@ @client.team_app_collaborator.create(app_id_or_app_name, body) end # Delete an existing collaborator from a team app. # - # @param app_name: unique name of app + # @param team_app_identity: # @param collaborator_email: invited email address of collaborator - def delete(app_name, collaborator_email) - @client.team_app_collaborator.delete(app_name, collaborator_email) + def delete(team_app_identity, collaborator_email) + @client.team_app_collaborator.delete(team_app_identity, collaborator_email) end # Info for a collaborator on a team app. # - # @param app_name: unique name of app + # @param team_app_identity: # @param collaborator_email: invited email address of collaborator - def info(app_name, collaborator_email) - @client.team_app_collaborator.info(app_name, collaborator_email) + def info(team_app_identity, collaborator_email) + @client.team_app_collaborator.info(team_app_identity, collaborator_email) end # Update an existing collaborator from a team app. # - # @param app_name: unique name of app + # @param team_app_identity: # @param collaborator_email: invited email address of collaborator # @param body: the object to pass as the request payload - def update(app_name, collaborator_email, body = {}) - @client.team_app_collaborator.update(app_name, collaborator_email, body) + def update(team_app_identity, collaborator_email, body = {}) + @client.team_app_collaborator.update(team_app_identity, collaborator_email, body) end # List collaborators on a team app. # - # @param app_name: unique name of app - def list(app_name) - @client.team_app_collaborator.list(app_name) + # @param team_app_identity: + def list(team_app_identity) + @client.team_app_collaborator.list(team_app_identity) end end # A team app permission is a behavior that is assigned to a user in a team app. class TeamAppPermission @@ -3119,37 +3145,37 @@ @client.team_app.create(body) end # Info for a team app. # - # @param app_name: unique name of app - def info(app_name) - @client.team_app.info(app_name) + # @param team_app_identity: + def info(team_app_identity) + @client.team_app.info(team_app_identity) end # Lock or unlock a team app. # - # @param app_name: unique name of app + # @param team_app_identity: # @param body: the object to pass as the request payload - def update_locked(app_name, body = {}) - @client.team_app.update_locked(app_name, body) + def update_locked(team_app_identity, body = {}) + @client.team_app.update_locked(team_app_identity, body) end # Transfer an existing team app to another Heroku account. # - # @param app_name: unique name of app + # @param team_app_identity: # @param body: the object to pass as the request payload - def transfer_to_account(app_name, body = {}) - @client.team_app.transfer_to_account(app_name, body) + def transfer_to_account(team_app_identity, body = {}) + @client.team_app.transfer_to_account(team_app_identity, body) end # Transfer an existing team app to another team. # - # @param app_name: unique name of app + # @param team_app_identity: # @param body: the object to pass as the request payload - def transfer_to_team(app_name, body = {}) - @client.team_app.transfer_to_team(app_name, body) + def transfer_to_team(team_app_identity, body = {}) + @client.team_app.transfer_to_team(team_app_identity, body) end # List team apps. # # @param team_name_or_team_id: unique name of team or unique identifier of team @@ -3172,10 +3198,24 @@ def info(team_id, body = {}) @client.team_daily_usage.info(team_id, body) end end + # A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid. + class TeamDelinquency + def initialize(client) + @client = client + end + + # Team delinquency information. + # + # @param team_name_or_team_id: unique name of team or unique identifier of team + def info(team_name_or_team_id) + @client.team_delinquency.info(team_name_or_team_id) + end + end + # A team feature represents a feature enabled on a team account. class TeamFeature def initialize(client) @client = client end @@ -3408,21 +3448,21 @@ @client.team.delete(team_name_or_team_id) end # List teams for an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account - def list_by_enterprise_account(enterprise_account_id) - @client.team.list_by_enterprise_account(enterprise_account_id) + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account + def list_by_enterprise_account(enterprise_account_id_or_enterprise_account_name) + @client.team.list_by_enterprise_account(enterprise_account_id_or_enterprise_account_name) end # Create a team in an enterprise account. # - # @param enterprise_account_id: unique identifier of the enterprise account + # @param enterprise_account_id_or_enterprise_account_name: unique identifier of the enterprise account or unique name of the enterprise account # @param body: the object to pass as the request payload - def create_in_enterprise_account(enterprise_account_id, body = {}) - @client.team.create_in_enterprise_account(enterprise_account_id, body) + def create_in_enterprise_account(enterprise_account_id_or_enterprise_account_name, body = {}) + @client.team.create_in_enterprise_account(enterprise_account_id_or_enterprise_account_name, body) end end # A single test case belonging to a test run class TestCase @@ -3570,10 +3610,62 @@ "$schema": "http://interagent.github.io/interagent-hyper-schema", "type": [ "object" ], "definitions": { + "account-delinquency": { + "description": "A Heroku account becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent accounts if their invoices remain unpaid.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Account Delinquency", + "type": [ + "object" + ], + "definitions": { + "scheduled_suspension_time": { + "description": "scheduled time of when we will suspend your account due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "scheduled_deletion_time": { + "description": "scheduled time of when we will delete your account due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Account delinquency information.", + "href": "/account/delinquency", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/account-delinquency" + }, + "title": "Info" + } + ], + "properties": { + "scheduled_suspension_time": { + "$ref": "#/definitions/account-delinquency/definitions/scheduled_suspension_time" + }, + "scheduled_deletion_time": { + "$ref": "#/definitions/account-delinquency/definitions/scheduled_deletion_time" + } + } + }, "account-feature": { "description": "An account feature represents a Heroku labs capability that can be enabled or disabled for an account on Heroku.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, @@ -9463,11 +9555,11 @@ "boolean", "null" ] }, "size": { - "description": "dyno size (default: \"standard-1X\")", + "description": "dyno size", "example": "standard-1X", "readOnly": false, "type": [ "string" ] @@ -10365,10 +10457,13 @@ }, "identity": { "anyOf": [ { "$ref": "#/definitions/enterprise-account/definitions/id" + }, + { + "$ref": "#/definitions/enterprise-account/definitions/name" } ] }, "identity_provider": { "description": "Identity Provider associated with the Enterprise Account", @@ -10615,11 +10710,11 @@ "type": [ "integer" ] }, "size": { - "description": "dyno size (default: \"standard-1X\")", + "description": "dyno size", "example": "standard-1X", "readOnly": false, "type": [ "string" ] @@ -10789,11 +10884,11 @@ "$ref": "#/definitions/formation/definitions/updated_at" } } }, "identity-provider": { - "description": "Identity Providers represent the SAML configuration of an Enterprise Account or Team.", + "description": "Identity Providers represent the SAML configuration of teams or an Enterprise account", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "production", "strictProperties": true, "title": "Heroku Platform API - Identity Provider", "type": [ @@ -12420,11 +12515,11 @@ "$ref": "#/definitions/oauth-client" }, "title": "Delete" }, { - "description": "Info for an OAuth client", + "description": "Info for an OAuth client. The output for unauthenticated requests excludes the `secret` parameter.", "href": "/oauth/clients/{(%23%2Fdefinitions%2Foauth-client%2Fdefinitions%2Fidentity)}", "method": "GET", "rel": "self", "title": "Info" }, @@ -12602,11 +12697,11 @@ } ] }, "token": { "description": "contents of the token to be used for authorization", - "example": "01234567-89ab-cdef-0123-456789abcdef", + "example": "HRKU-01234567-89ab-cdef-0123-456789abcdef", "readOnly": true, "type": [ "string" ] }, @@ -12800,13 +12895,15 @@ } }, "outbound-ruleset": { "description": "An outbound-ruleset is a collection of rules that specify what hosts Dynos are allowed to communicate with. ", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", + "stability": "deprecation", "strictProperties": true, "title": "Heroku Platform API - Outbound Ruleset", + "deprecated_at": "2024-04-30", + "deactivate_on": "2024-06-03", "type": [ "object" ], "definitions": { "target": { @@ -16968,11 +17065,11 @@ ] }, "space": { "description": "A space is an isolated, highly available, secure app execution environment.", "$schema": "http://json-schema.org/draft-04/hyper-schema", - "stability": "prototype", + "stability": "production", "strictProperties": true, "title": "Heroku Platform API - Space", "type": [ "object" ], @@ -17631,15 +17728,11 @@ "type": [ "boolean" ] }, "identity": { - "anyOf": [ - { - "$ref": "#/definitions/app/definitions/name" - } - ] + "$ref": "#/definitions/app/definitions/name" }, "internal_routing": { "default": false, "description": "describes whether a Private Spaces app is externally routable or not", "example": false, @@ -18117,10 +18210,62 @@ "space": { "$ref": "#/definitions/team-daily-usage/definitions/space" } } }, + "team-delinquency": { + "description": "A Heroku team becomes delinquent due to non-payment. We [suspend and delete](https://help.heroku.com/EREVRILX/what-happens-if-i-have-unpaid-heroku-invoices) delinquent teams if their invoices remain unpaid.", + "$schema": "http://json-schema.org/draft-04/hyper-schema", + "stability": "development", + "strictProperties": true, + "title": "Heroku Platform API - Team Delinquency", + "type": [ + "object" + ], + "definitions": { + "scheduled_suspension_time": { + "description": "scheduled time of when we will suspend your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + }, + "scheduled_deletion_time": { + "description": "scheduled time of when we will delete your team due to delinquency", + "example": "2024-01-01T12:00:00Z", + "format": "date-time", + "readOnly": true, + "type": [ + "string", + "null" + ] + } + }, + "links": [ + { + "description": "Team delinquency information.", + "href": "/teams/{(%23%2Fdefinitions%2Fteam%2Fdefinitions%2Fidentity)}/delinquency", + "method": "GET", + "rel": "self", + "targetSchema": { + "$ref": "#/definitions/team-delinquency" + }, + "title": "Info" + } + ], + "properties": { + "scheduled_suspension_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_suspension_time" + }, + "scheduled_deletion_time": { + "$ref": "#/definitions/team-delinquency/definitions/scheduled_deletion_time" + } + } + }, "team-feature": { "description": "A team feature represents a feature enabled on a team account.", "$schema": "http://json-schema.org/draft-04/hyper-schema", "stability": "development", "strictProperties": true, @@ -18780,11 +18925,11 @@ "type": [ "string" ] }, "two_factor_authentication": { - "description": "whether the Enterprise team member has two factor authentication enabled", + "description": "whether the team member has two factor authentication enabled", "example": true, "readOnly": true, "type": [ "boolean" ] @@ -20920,10 +21065,13 @@ } ] } }, "properties": { + "account-delinquency": { + "$ref": "#/definitions/account-delinquency" + }, "account-feature": { "$ref": "#/definitions/account-feature" }, "account": { "$ref": "#/definitions/account" @@ -21168,9 +21316,12 @@ "team-app": { "$ref": "#/definitions/team-app" }, "team-daily-usage": { "$ref": "#/definitions/team-daily-usage" + }, + "team-delinquency": { + "$ref": "#/definitions/team-delinquency" }, "team-feature": { "$ref": "#/definitions/team-feature" }, "team-invitation": {