Class: Sendara::Resources::Domains
Instance Method Summary
collapse
#initialize
Instance Method Details
#create(domain) ⇒ Object
14
15
16
|
# File 'lib/sendara/resources/domains.rb', line 14
def create(domain)
request(:post, "/v1/domains", body: { "domain" => domain }) || {}
end
|
#get(domain) ⇒ Object
18
19
20
|
# File 'lib/sendara/resources/domains.rb', line 18
def get(domain)
request(:get, "/v1/domains/#{encode(domain)}") || {}
end
|
#get_bimi(domain) ⇒ Object
26
27
28
|
# File 'lib/sendara/resources/domains.rb', line 26
def get_bimi(domain)
request(:get, "/v1/domains/#{encode(domain)}/bimi") || {}
end
|
#list ⇒ Object
8
9
10
11
12
|
# File 'lib/sendara/resources/domains.rb', line 8
def list
response = request(:get, "/v1/domains") || {}
domains = response["domains"]
domains.is_a?(Array) ? domains : []
end
|
#set_bimi(domain, logo_url) ⇒ Object
30
31
32
|
# File 'lib/sendara/resources/domains.rb', line 30
def set_bimi(domain, logo_url)
request(:put, "/v1/domains/#{encode(domain)}/bimi", body: { "logo_url" => logo_url }) || {}
end
|
#upload_bimi_logo(domain, svg, filename: "logo.svg") ⇒ Object
34
35
36
37
38
39
40
41
|
# File 'lib/sendara/resources/domains.rb', line 34
def upload_bimi_logo(domain, svg, filename: "logo.svg")
body = {
"filename" => filename,
"content_type" => "image/svg+xml",
"data" => Base64.strict_encode64(svg)
}
request(:post, "/v1/domains/#{encode(domain)}/bimi/logo", body: body) || {}
end
|
#verify(domain) ⇒ Object
22
23
24
|
# File 'lib/sendara/resources/domains.rb', line 22
def verify(domain)
request(:post, "/v1/domains/#{encode(domain)}/verify") || {}
end
|