Class: Yandex360::PasswordsResource
- Defined in:
- lib/yandex360/resources/passwords.rb
Overview
Password policy for the organization: whether users may change their own password, and how long a password stays valid.
See https://yandex.ru/dev/api360/doc/ru/ref/DomainPasswordsService/
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #info(org_id:) ⇒ Object
-
#update(org_id:, enabled: nil, change_frequency: nil) ⇒ Object
The API accepts either field on its own, but rejects an empty body, so nil values are dropped rather than sent.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Yandex360::Resource
Instance Method Details
#info(org_id:) ⇒ Object
9 10 11 12 |
# File 'lib/yandex360/resources/passwords.rb', line 9 def info(org_id:) validate_required_params({org_id: org_id}, [:org_id]) DomainPassword.new get("/security/v1/org/#{org_id}/domain_passwords").body end |
#update(org_id:, enabled: nil, change_frequency: nil) ⇒ Object
The API accepts either field on its own, but rejects an empty body, so nil values are dropped rather than sent.
16 17 18 19 20 21 22 23 24 |
# File 'lib/yandex360/resources/passwords.rb', line 16 def update(org_id:, enabled: nil, change_frequency: nil) validate_required_params({org_id: org_id}, [:org_id]) body = {} body[:enabled] = enabled unless enabled.nil? body[:changeFrequency] = change_frequency unless change_frequency.nil? raise ArgumentError, "Provide enabled or change_frequency" if body.empty? DomainPassword.new put("/security/v1/org/#{org_id}/domain_passwords", body: body).body end |