Class: Google::Apis::UrlshortenerV1::Url

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/urlshortener_v1/classes.rb,
generated/google/apis/urlshortener_v1/representations.rb,
generated/google/apis/urlshortener_v1/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Url

Returns a new instance of Url.



186
187
188
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 186

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#analyticsGoogle::Apis::UrlshortenerV1::AnalyticsSummary

A summary of the click analytics for the short and long URL. Might not be present if not requested or currently unavailable. Corresponds to the JSON property analytics



155
156
157
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 155

def analytics
  @analytics
end

#createdString

Time the short URL was created; ISO 8601 representation using the yyyy-MM-dd'T' HH:mm:ss.SSSZZ format, e.g. "2010-10-14T19:01:24.944+00:00". Corresponds to the JSON property created

Returns:

  • (String)


161
162
163
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 161

def created
  @created
end

#idString

Short URL, e.g. "http://goo.gl/l6MS". Corresponds to the JSON property id

Returns:

  • (String)


166
167
168
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 166

def id
  @id
end

#kindString

The fixed string "urlshortener#url". Corresponds to the JSON property kind

Returns:

  • (String)


171
172
173
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 171

def kind
  @kind
end

#long_urlString

Long URL, e.g. "http://www.google.com/". Might not be present if the status is "REMOVED". Corresponds to the JSON property longUrl

Returns:

  • (String)


177
178
179
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 177

def long_url
  @long_url
end

#statusString

Status of the target URL. Possible values: "OK", "MALWARE", "PHISHING", or " REMOVED". A URL might be marked "REMOVED" if it was flagged as spam, for example. Corresponds to the JSON property status

Returns:

  • (String)


184
185
186
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 184

def status
  @status
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



191
192
193
194
195
196
197
198
# File 'generated/google/apis/urlshortener_v1/classes.rb', line 191

def update!(**args)
  @analytics = args[:analytics] if args.key?(:analytics)
  @created = args[:created] if args.key?(:created)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @long_url = args[:long_url] if args.key?(:long_url)
  @status = args[:status] if args.key?(:status)
end