Skip to content

Commit

Permalink
fix: support for other properties on zone
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcooke committed Apr 1, 2021
1 parent 8162ac6 commit c8ad495
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/dennis/zone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ def find_by(client, field, value)
e.code == 'zone_not_found' ? nil : raise
end

def create(client, group:, name:, external_reference: nil)
def create(client,
group:,
allow_sub_domains_of_zones_in_other_groups: nil,
**properties)
request = client.api.create_request(:post, 'zones')
request.arguments[:group] = group
request.arguments[:properties] = { name: name, external_reference: external_reference }
request.arguments[:properties] = properties
unless allow_sub_domains_of_zones_in_other_groups.nil?
request.arguments[:allow_sub_domains_of_zones_in_other_groups] = allow_sub_domains_of_zones_in_other_groups
end
new(client, request.perform.hash['zone'])
rescue RapidAPI::RequestError => e
raise GroupNotFoundError if e.code == 'group_not_found'
Expand Down

0 comments on commit c8ad495

Please sign in to comment.