Class: GreenButtonData::ApplicationInformation

Inherits:
Entry
  • Object
show all
Includes:
Enumerations, Utilities
Defined in:
lib/green-button-data/application_information.rb

Constant Summary

Constants included from Enumerations

Enumerations::ACCUMULATION, Enumerations::AUTHORIZATION_STATUS, Enumerations::COMMODITY, Enumerations::CURRENCY, Enumerations::DATA_CUSTODIAN_APPLICATION_STATUS, Enumerations::DATA_QUALIFIER, Enumerations::ESPI_SERVICE_STATUS, Enumerations::FLOW_DIRECTION, Enumerations::MEASUREMENT, Enumerations::PHASE_CODE, Enumerations::QUALITY_OF_READING, Enumerations::SERVICE, Enumerations::THIRD_PARTY_APPLICATION_STATUS, Enumerations::THIRD_PARTY_APPLICATION_TYPE, Enumerations::THIRD_PARTY_APPLICATION_USE, Enumerations::TIME_ATTRIBUTE, Enumerations::TIME_PERIOD_OF_INTEREST, Enumerations::UNIT_MULTIPLIER, Enumerations::UNIT_SYMBOL

Instance Attribute Summary collapse

Attributes inherited from Entry

#id, #token, #usage_point_id

Instance Method Summary collapse

Methods included from Utilities

#attributes_to_hash, #class_from_name, #epoch_to_time, #first_sunday_of, #last_weekday_of, #normalize_epoch, #nth_weekday_of, #parse_datetime, #weekday_offset

Methods inherited from Entry

#initialize

Methods included from Fetchable

included

Constructor Details

This class inherits a constructor from GreenButtonData::Entry

Instance Attribute Details

#authorization_server_authorization_endpointObject

Returns the value of attribute authorization_server_authorization_endpoint.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def authorization_server_authorization_endpoint
  @authorization_server_authorization_endpoint
end

#authorization_server_registration_endpointObject

Returns the value of attribute authorization_server_registration_endpoint.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def authorization_server_registration_endpoint
  @authorization_server_registration_endpoint
end

#authorization_server_token_endpointObject

Returns the value of attribute authorization_server_token_endpoint.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def authorization_server_token_endpoint
  @authorization_server_token_endpoint
end

#authorization_server_uriObject

Returns the value of attribute authorization_server_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def authorization_server_uri
  @authorization_server_uri
end

#client_idObject

Returns the value of attribute client_id.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def client_id
  @client_id
end

#client_nameObject

Returns the value of attribute client_name.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def client_name
  @client_name
end

#client_secretObject

Returns the value of attribute client_secret.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def client_secret
  @client_secret
end

#contactsObject

Returns the value of attribute contacts.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def contacts
  @contacts
end

#data_custodian_bulk_request_uriObject

Returns the value of attribute data_custodian_bulk_request_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def data_custodian_bulk_request_uri
  @data_custodian_bulk_request_uri
end

#data_custodian_idObject

Returns the value of attribute data_custodian_id.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def data_custodian_id
  @data_custodian_id
end

#data_custodian_resource_endpointObject

Returns the value of attribute data_custodian_resource_endpoint.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def data_custodian_resource_endpoint
  @data_custodian_resource_endpoint
end

#data_custodian_scope_selection_screen_uriObject

Returns the value of attribute data_custodian_scope_selection_screen_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def data_custodian_scope_selection_screen_uri
  @data_custodian_scope_selection_screen_uri
end

#grant_typesObject

Returns the value of attribute grant_types.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def grant_types
  @grant_types
end

#redirect_uriObject

Returns the value of attribute redirect_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def redirect_uri
  @redirect_uri
end

#registration_access_tokenObject

Returns the value of attribute registration_access_token.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def registration_access_token
  @registration_access_token
end

#registration_client_uriObject

Returns the value of attribute registration_client_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def registration_client_uri
  @registration_client_uri
end

#response_typesObject

Returns the value of attribute response_types.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def response_types
  @response_types
end

#scopesObject

Returns the value of attribute scopes.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def scopes
  @scopes
end

#software_idObject

Returns the value of attribute software_id.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def software_id
  @software_id
end

#software_versionObject

Returns the value of attribute software_version.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def software_version
  @software_version
end

#third_party_application_descriptionObject

Returns the value of attribute third_party_application_description.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def third_party_application_description
  @third_party_application_description
end

#third_party_notify_uriObject

Returns the value of attribute third_party_notify_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def third_party_notify_uri
  @third_party_notify_uri
end

#third_party_phoneObject

Returns the value of attribute third_party_phone.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def third_party_phone
  @third_party_phone
end

#third_party_scope_selection_screen_uriObject

Returns the value of attribute third_party_scope_selection_screen_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def third_party_scope_selection_screen_uri
  @third_party_scope_selection_screen_uri
end

#third_party_user_portal_screen_uriObject

Returns the value of attribute third_party_user_portal_screen_uri.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def third_party_user_portal_screen_uri
  @third_party_user_portal_screen_uri
end

#token_endpoint_auth_methodObject

Returns the value of attribute token_endpoint_auth_method.



6
7
8
# File 'lib/green-button-data/application_information.rb', line 6

def token_endpoint_auth_method
  @token_endpoint_auth_method
end

Instance Method Details

#client_id_issued_at(kwargs = {}) ⇒ Object



33
34
35
# File 'lib/green-button-data/application_information.rb', line 33

def client_id_issued_at(kwargs = {})
  epoch_to_time @client_id_issued_at, kwargs
end

#client_secret_expires_at(kwargs = {}) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/green-button-data/application_information.rb', line 37

def client_secret_expires_at(kwargs = {})
  if @client_secret_expires_at == 0
    # Maximum Fixnum = 4611686018427387903
    max_fixnum = 2 ** (@client_secret_expires_at.size * 8 - 2) - 1

    # Roughly 146 billion years into the future; Sun would be long dead by
    # this time; so for all intents and purposes, never expires
    time = Time.at(max_fixnum)

    if kwargs[:local] == true
      return time.localtime
    else
      return time.utc
    end
  else
    epoch_to_time(@client_secret_expires_at, kwargs)
  end
end

#data_custodian_application_statusObject



56
57
58
59
# File 'lib/green-button-data/application_information.rb', line 56

def data_custodian_application_status
  get_enum_symbol DATA_CUSTODIAN_APPLICATION_STATUS,
                  @data_custodian_application_status
end

#third_party_application_typeObject



61
62
63
64
# File 'lib/green-button-data/application_information.rb', line 61

def third_party_application_type
  get_enum_symbol THIRD_PARTY_APPLICATION_TYPE,
                  @third_party_application_type
end

#third_party_application_useObject



66
67
68
# File 'lib/green-button-data/application_information.rb', line 66

def third_party_application_use
  get_enum_symbol THIRD_PARTY_APPLICATION_USE, @third_party_application_use
end

#to_hObject



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/green-button-data/application_information.rb', line 70

def to_h
  {
    authorization_server_authorization_endpoint:
      authorization_server_authorization_endpoint,
    authorization_server_registration_endpoint:
      authorization_server_registration_endpoint,
    authorization_server_token_endpoint:
      authorization_server_token_endpoint,
    authorization_server_uri: authorization_server_uri,
    contacts: contacts,
    client_id: client_id,
    client_id_issued_at: client_id_issued_at,
    client_name: client_name,
    client_secret: client_secret,
    client_secret_expires_at: client_secret_expires_at,
    data_custodian_application_status: data_custodian_application_status,
    data_custodian_bulk_request_uri: data_custodian_bulk_request_uri,
    data_custodian_id: data_custodian_id,
    data_custodian_resource_endpoint: data_custodian_resource_endpoint,
    data_custodian_scope_selection_screen_uri:
      data_custodian_scope_selection_screen_uri,
    grant_types: grant_types,
    redirect_uri: redirect_uri,
    registration_access_token: registration_access_token,
    registration_client_uri: registration_client_uri,
    response_types: response_types,
    scopes: scopes,
    software_id: software_id,
    software_version: software_version,
    third_party_application_description:
      third_party_application_description,
    third_party_application_type: third_party_application_type,
    third_party_application_use: third_party_application_use,
    third_party_notify_uri: third_party_notify_uri,
    third_party_phone: third_party_phone,
    third_party_scope_selection_screen_uri:
      third_party_scope_selection_screen_uri,
    third_party_user_portal_screen_uri: third_party_user_portal_screen_uri,
    token_endpoint_auth_method: token_endpoint_auth_method
  }
end