Sha256: 1243e3a04a02263b2d14b1fe4bbb34808b5a7a258cd7e00936bddc5a89d6caaf

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

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

module SendGrid4r
  module REST
    module Settings
      #
      # SendGrid Web API v3 Settings - EnforcedTls
      #
      module EnforcedTls
        include SendGrid4r::REST::Request
        EnforcedTls = Struct.new(:require_tls, :require_valid_cert)

        def self.create_enforced_tls(resp)
          return resp if resp.nil?
          EnforcedTls.new(resp['require_tls'], resp['require_valid_cert'])
        end

        def self.url
          "#{BASE_URL}/user/settings/enforced_tls"
        end

        def get_enforced_tls(&block)
          endpoint = SendGrid4r::REST::Settings::EnforcedTls.url
          resp = get(@auth, endpoint, &block)
          SendGrid4r::REST::Settings::EnforcedTls.create_enforced_tls(resp)
        end

        def patch_enforced_tls(params:, &block)
          endpoint = SendGrid4r::REST::Settings::EnforcedTls.url
          resp = patch(@auth, endpoint, params.to_h, &block)
          SendGrid4r::REST::Settings::EnforcedTls.create_enforced_tls(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/settings/enforced_tls.rb
sendgrid4r-1.8.0 lib/sendgrid4r/rest/settings/enforced_tls.rb
sendgrid4r-1.7.1 lib/sendgrid4r/rest/settings/enforced_tls.rb
sendgrid4r-1.7.0 lib/sendgrid4r/rest/settings/enforced_tls.rb
sendgrid4r-1.6.0 lib/sendgrid4r/rest/settings/enforced_tls.rb
sendgrid4r-1.5.1 lib/sendgrid4r/rest/settings/enforced_tls.rb