Class: Zavudev::Resources::URLs

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

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:



109
110
111
# File 'lib/zavudev/resources/urls.rb', line 109

def initialize(client:)
  @client = client
end

Instance Method Details

#escalate(url_id, reason:, request_options: {}) ⇒ Zavudev::Models::URLEscalateResponse

Request manual review of a rejected URL. Only URLs in 'rejected' status can be escalated; the status then moves to 'escalated'.

Parameters:

  • url_id (String)
  • reason (String) —

    Why the URL should be reviewed manually.

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

Returns:

See Also:



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

def escalate(url_id, params)
  parsed, options = Zavudev::URLEscalateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["v1/urls/%1$s/escalate", url_id],
    body: parsed,
    model: Zavudev::Models::URLEscalateResponse,
    options: options
  )
end

#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:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/zavudev/resources/urls.rb', line 46

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:



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

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:



95
96
97
98
99
100
101
102
103
104
# File 'lib/zavudev/resources/urls.rb', line 95

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