Sha256: 94089a2037bf7bf5dacf5c4164b2f8424a0edfa162d292484dfd235b1e9d7d0c

Contents?: true

Size: 726 Bytes

Versions: 6

Compression:

Stored size: 726 Bytes

Contents

# -*- encoding: utf-8 -*-

module SendGrid4r
  module REST
    #
    # SendGrid Web API v3 ApiKeys
    #
    module ApiKeys
      #
      # SendGrid Web API v3 ApiKeys Permissions
      #
      module Permissions
        include SendGrid4r::REST::Request

        Permissions = Struct.new(:scopes)

        def self.url
          "#{BASE_URL}/scopes"
        end

        def self.create_permissions(resp)
          return resp if resp.nil?
          Permissions.new(resp['scopes'])
        end

        def get_permissions(&block)
          resp = get(@auth, SendGrid4r::REST::ApiKeys::Permissions.url, &block)
          SendGrid4r::REST::ApiKeys::Permissions.create_permissions(resp)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sendgrid4r-1.8.1 lib/sendgrid4r/rest/api_keys/permissions.rb
sendgrid4r-1.8.0 lib/sendgrid4r/rest/api_keys/permissions.rb
sendgrid4r-1.7.1 lib/sendgrid4r/rest/api_keys/permissions.rb
sendgrid4r-1.7.0 lib/sendgrid4r/rest/api_keys/permissions.rb
sendgrid4r-1.6.0 lib/sendgrid4r/rest/api_keys/permissions.rb
sendgrid4r-1.5.1 lib/sendgrid4r/rest/api_keys/permissions.rb