Class: Strava::Webhooks::Models::Subscription

Inherits:
Models::Response show all
Defined in:
lib/strava/webhooks/models/subscription.rb

Overview

Represents a webhook subscription.

Webhook subscriptions allow your application to receive real-time notifications when athletes create or update activities, or update their profile information. Each subscription is associated with a callback URL where events will be posted.

Examples:

List subscriptions

subscriptions = client.subscriptions
subscriptions.each do |sub|
  puts "Subscription #{sub.id}: #{sub.callback_url}"
end

See Also:

Instance Method Summary collapse

Instance Method Details

#application_idInteger

Returns The ID of the application that created the subscription.

Returns:

  • (Integer)

    The ID of the application that created the subscription



27
# File 'lib/strava/webhooks/models/subscription.rb', line 27

property 'application_id'

#callback_urlString

Returns The callback URL where webhook events will be posted.

Returns:

  • (String)

    The callback URL where webhook events will be posted



30
# File 'lib/strava/webhooks/models/subscription.rb', line 30

property 'callback_url'

#created_atTime

Returns When the subscription was created.

Returns:

  • (Time)

    When the subscription was created



36
# File 'lib/strava/webhooks/models/subscription.rb', line 36

property 'created_at', transform_with: ->(v) { Time.parse(v) }

#idInteger

Returns The subscription ID.

Returns:

  • (Integer)

    The subscription ID



24
# File 'lib/strava/webhooks/models/subscription.rb', line 24

property 'id'

#resource_stateInteger

Returns Resource state indicator.

Returns:

  • (Integer)

    Resource state indicator



33
# File 'lib/strava/webhooks/models/subscription.rb', line 33

property 'resource_state'

#updated_atTime

Returns When the subscription was last updated.

Returns:

  • (Time)

    When the subscription was last updated



39
# File 'lib/strava/webhooks/models/subscription.rb', line 39

property 'updated_at', transform_with: ->(v) { Time.parse(v) }