Sha256: 989376969288469350f5da349e384a5f5c8ef5ca466a78af798fcb12a378219e

Contents?: true

Size: 1.7 KB

Versions: 6

Compression:

Stored size: 1.7 KB

Contents

# Copyright 2000-2014 NeuStar, Inc. All rights reserved.
# NeuStar, the Neustar logo and related names and logos are registered
# trademarks, service marks or tradenames of NeuStar, Inc. All other
# product names, company names, marks, logos and symbols may be trademarks
# of their respective owners.

require_relative 'client_accessor'

class Ultradns::Api::Account < Ultradns::Api::ClientAccessor

  attr_reader :account_name

  def initialize(client, account_name)
    super(client)
    @account_name = account_name
  end


  # List zones for this account
  #
  #
  # === Optional Parameters
  #
  # * +:q+ - The search parameters, in a hash.  Valid keys are:
  #          name - substring match of the zone name
  #          zone_type - one of :
  #              PRIMARY
  #              SECONDARY
  #              ALIAS
  # * +:sort+ - The sort column used to order the list. Valid values for the sort field are:
  #             NAME
  #             ACCOUNT_NAME
  #             RECORD_COUNT
  #             ZONE_TYPE
  # * +:reverse+ - Whether the list is ascending(false) or descending(true).  Defaults to true
  # * +:offset+ - The position in the list for the first returned element(0 based)
  # * +:limit+ - The maximum number of zones to be returned.
  #
  # === Examples
  #
  #     client.account('myaccount').zones
  #     client.account('myaccount').zones(q: {name: 'foo', zone_type: 'PRIMARY'}, sort: 'NAME', reverse: true, offset:10, limit:50)
  def zones(options={})
    client.with_auth_retry {|c| c.get("/accounts/#{@account_name}/zones", request_options(options)) }
  end

  # List users for this account
  def users()
    client.with_auth_retry {|c| c.get "/accounts/#{@account_name}/users", request_options }
  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ultradns-sdk-fixed-0.0.7 lib/ultradns/api/account.rb
ultradns-sdk-0.0.6 lib/ultradns/api/account.rb
ultradns-sdk-0.0.5 lib/ultradns/api/account.rb
ultradns-sdk-0.0.4 lib/ultradns/api/account.rb
ultradns-sdk-0.0.3 lib/ultradns/api/account.rb
ultradns-sdk-0.0.2 lib/ultradns/api/account.rb