Class: Yandex360::DomainPoliciesResource
- Defined in:
- lib/yandex360/resources/domain_policies.rb
Overview
Domain level rules for incoming mail: which senders are accepted, rejected or forced to spam.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #list(org_id:) ⇒ Object
-
#set(org_id:, rules:) ⇒ Object
Replaces the whole rule set: the API takes the full list, not a patch, so anything left out is removed.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Yandex360::Resource
Instance Method Details
#list(org_id:) ⇒ Object
9 10 11 12 |
# File 'lib/yandex360/resources/domain_policies.rb', line 9 def list(org_id:) validate_required_params({org_id: org_id}, [:org_id]) DomainPolicy.new get("/admin/v1/org/#{org_id}/mail/routing/policies").body end |
#set(org_id:, rules:) ⇒ Object
Replaces the whole rule set: the API takes the full list, not a patch, so anything left out is removed.
16 17 18 19 |
# File 'lib/yandex360/resources/domain_policies.rb', line 16 def set(org_id:, rules:) validate_required_params({org_id: org_id, rules: rules}, %i[org_id rules]) Response.new put("/admin/v1/org/#{org_id}/mail/routing/policies", body: {rules: rules}).body end |