Class: Yandex360::ServiceApplicationsResource
- Defined in:
- lib/yandex360/resources/service_applications.rb
Overview
Service applications and the scopes granted to them.
See https://yandex.ru/dev/api360/doc/ru/ref/ServiceApplicationsService/
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #activate(org_id:) ⇒ Object
-
#create(org_id:, applications:) ⇒ Object
Replaces the stored list with the one given.
- #deactivate(org_id:) ⇒ Object
-
#delete(org_id:) ⇒ Object
Clears the whole list.
- #list(org_id:) ⇒ Object
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Yandex360::Resource
Instance Method Details
#activate(org_id:) ⇒ Object
28 29 30 31 |
# File 'lib/yandex360/resources/service_applications.rb', line 28 def activate(org_id:) validate_required_params({org_id: org_id}, [:org_id]) Response.new post("/security/v1/org/#{org_id}/service_applications/activate", body: {}).body end |
#create(org_id:, applications:) ⇒ Object
Replaces the stored list with the one given.
15 16 17 18 19 |
# File 'lib/yandex360/resources/service_applications.rb', line 15 def create(org_id:, applications:) validate_required_params({org_id: org_id, applications: applications}, %i[org_id applications]) resp = post("/security/v1/org/#{org_id}/service_applications", body: {applications: applications}) Collection.from_response(resp, key: "applications", type: ServiceApplication) end |
#deactivate(org_id:) ⇒ Object
33 34 35 36 |
# File 'lib/yandex360/resources/service_applications.rb', line 33 def deactivate(org_id:) validate_required_params({org_id: org_id}, [:org_id]) Response.new post("/security/v1/org/#{org_id}/service_applications/deactivate", body: {}).body end |
#delete(org_id:) ⇒ Object
Clears the whole list. There is no per-application delete.
22 23 24 25 26 |
# File 'lib/yandex360/resources/service_applications.rb', line 22 def delete(org_id:) validate_required_params({org_id: org_id}, [:org_id]) resp = delete_request("/security/v1/org/#{org_id}/service_applications") Collection.from_response(resp, key: "applications", type: ServiceApplication) end |
#list(org_id:) ⇒ Object
8 9 10 11 12 |
# File 'lib/yandex360/resources/service_applications.rb', line 8 def list(org_id:) validate_required_params({org_id: org_id}, [:org_id]) resp = get("/security/v1/org/#{org_id}/service_applications") Collection.from_response(resp, key: "applications", type: ServiceApplication) end |