Class: OpenAI::Resources::Admin::Organization::SpendAlerts
- Inherits:
-
Object
- Object
- OpenAI::Resources::Admin::Organization::SpendAlerts
- Defined in:
- lib/openai/resources/admin/organization/spend_alerts.rb
Instance Method Summary collapse
-
#create(currency:, interval:, notification_channel:, threshold_amount:, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlert
Creates an organization spend alert.
-
#delete(alert_id, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlertDeleted
Deletes an organization spend alert.
-
#initialize(client:) ⇒ SpendAlerts
constructor
private
A new instance of SpendAlerts.
-
#list(after: nil, before: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Admin::Organization::OrganizationSpendAlert>
Some parameter documentations has been truncated, see Models::Admin::Organization::SpendAlertListParams for more details.
-
#update(alert_id, currency:, interval:, notification_channel:, threshold_amount:, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlert
Updates an organization spend alert.
Constructor Details
#initialize(client:) ⇒ SpendAlerts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SpendAlerts.
126 127 128 |
# File 'lib/openai/resources/admin/organization/spend_alerts.rb', line 126 def initialize(client:) @client = client end |
Instance Method Details
#create(currency:, interval:, notification_channel:, threshold_amount:, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlert
Creates an organization spend alert.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/openai/resources/admin/organization/spend_alerts.rb', line 25 def create(params) parsed, = OpenAI::Admin::Organization::SpendAlertCreateParams.dump_request(params) @client.request( method: :post, path: "organization/spend_alerts", body: parsed, model: OpenAI::Admin::Organization::OrganizationSpendAlert, security: {admin_api_key_auth: true}, options: ) end |
#delete(alert_id, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlertDeleted
Deletes an organization spend alert.
113 114 115 116 117 118 119 120 121 |
# File 'lib/openai/resources/admin/organization/spend_alerts.rb', line 113 def delete(alert_id, params = {}) @client.request( method: :delete, path: ["organization/spend_alerts/%1$s", alert_id], model: OpenAI::Admin::Organization::OrganizationSpendAlertDeleted, security: {admin_api_key_auth: true}, options: params[:request_options] ) end |
#list(after: nil, before: nil, limit: nil, order: nil, request_options: {}) ⇒ OpenAI::Internal::ConversationCursorPage<OpenAI::Models::Admin::Organization::OrganizationSpendAlert>
Some parameter documentations has been truncated, see Models::Admin::Organization::SpendAlertListParams for more details.
Lists organization spend alerts.
88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/openai/resources/admin/organization/spend_alerts.rb', line 88 def list(params = {}) parsed, = OpenAI::Admin::Organization::SpendAlertListParams.dump_request(params) query = OpenAI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "organization/spend_alerts", query: query, page: OpenAI::Internal::ConversationCursorPage, model: OpenAI::Admin::Organization::OrganizationSpendAlert, security: {admin_api_key_auth: true}, options: ) end |
#update(alert_id, currency:, interval:, notification_channel:, threshold_amount:, request_options: {}) ⇒ OpenAI::Models::Admin::Organization::OrganizationSpendAlert
Updates an organization spend alert.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/openai/resources/admin/organization/spend_alerts.rb', line 56 def update(alert_id, params) parsed, = OpenAI::Admin::Organization::SpendAlertUpdateParams.dump_request(params) @client.request( method: :post, path: ["organization/spend_alerts/%1$s", alert_id], body: parsed, model: OpenAI::Admin::Organization::OrganizationSpendAlert, security: {admin_api_key_auth: true}, options: ) end |