Class: Zavudev::Resources::URLs

Inherits:
Object
  • Object
show all
Defined in:
lib/zavudev/resources/urls.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ URLs

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of URLs.

Parameters:



84
85
86
# File 'lib/zavudev/resources/urls.rb', line 84

def initialize(client:)
  @client = client
end

Instance Method Details

#list_verified(cursor: nil, limit: nil, status: nil, request_options: {}) ⇒ Zavudev::Internal::Cursor<Zavudev::Models::VerifiedURL>

List URLs that have been verified for this project.

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/zavudev/resources/urls.rb', line 21

def list_verified(params = {})
  parsed, options = Zavudev::URLListVerifiedParams.dump_request(params)
  query = Zavudev::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/urls",
    query: query,
    page: Zavudev::Internal::Cursor,
    model: Zavudev::VerifiedURL,
    options: options
  )
end

#retrieve_details(url_id, request_options: {}) ⇒ Zavudev::Models::URLRetrieveDetailsResponse

Get details of a specific verified URL.

Parameters:

Returns:

See Also:



44
45
46
47
48
49
50
51
# File 'lib/zavudev/resources/urls.rb', line 44

def retrieve_details(url_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/urls/%1$s", url_id],
    model: Zavudev::Models::URLRetrieveDetailsResponse,
    options: params[:request_options]
  )
end

#submit_for_verification(url:, request_options: {}) ⇒ Zavudev::Models::URLSubmitForVerificationResponse

Submit a URL for verification. URLs are automatically checked against Google Web Risk API. Safe URLs are auto-approved, malicious URLs are blocked. URL shorteners (bit.ly, t.co, etc.) are always blocked.

Important: All SMS and Email messages containing URLs require those URLs to be verified before the message can be sent. This endpoint allows pre-verification of URLs.

Parameters:

  • url (String)

    The URL to submit for verification.

  • request_options (Zavudev::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



70
71
72
73
74
75
76
77
78
79
# File 'lib/zavudev/resources/urls.rb', line 70

def submit_for_verification(params)
  parsed, options = Zavudev::URLSubmitForVerificationParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/urls",
    body: parsed,
    model: Zavudev::Models::URLSubmitForVerificationResponse,
    options: options
  )
end