Module: Genability::Client::LoadServingEntity

Included in:
Genability::Client
Defined in:
lib/genability/client/load_serving_entity.rb

Overview

Load Serving Entity (LSE) is the industry term for what most people would call a utility, or an electric company. Since there are different types of electric company, we use the term LSE in our API's. This is a company or other organization that supplies load (electrons, electricity) to a customer. In many cases this is the same company that distributes the electricity too, but in some cases customers can have one company that they buy the load from, and another that operates the distribution system (runs the line to the house, manages the meters etc). Some characteristics and uses:

  1. LSE's have territories that they operate in. Sometimes they operate in more than 1.
  2. LSE's have tariffs (rate plans) and are central to many of our data structures.

Instance Method Summary collapse

Instance Method Details

#load_serving_entities(options = {}) ⇒ Array Also known as: lses

Returns a list of load serving entities

Examples:

Return the first 25 load serving entities

Genability.load_serving_entities

Return the next 25 load serving entities

Genability.load_serving_entities(:page => 2)

Return only 10 load serving entities

Genability.load_serving_entities(:per_page => 10)

Search for load serving entities starting with the letters 'Ka'

Genability.load_serving_entities(:search => 'Ka', :starts_with => 'true')

Search for load serving entities ending with the word 'Inc'

Genability.load_serving_entities(:search => 'Inc', :ends_with => 'true')

Search for load serving entities with the word 'Energy'

Genability.load_serving_entities(:search => 'Energy')

Search for load serving entities with a regular expression

Genability.load_serving_entities(:search => /\w{5,}/)

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :page (Integer)

    The page number to begin the result set from. If not specified, this will begin with the first result set. (Optional)

  • :per_page (Integer)

    The number of results to return. If not specified, this will return 25 results. (Optional)

  • :search (String)

    The string of text to search on. This can also be a regular expression, in which case you should set the 'isRegex' flag to true. (Optional)

  • :search_on (String)

    Comma separated list of fields to query on. When searchOn is specified, the text provided in the search string field will be searched within these fields. The list of fields to search on depend on the entity being searched for. Read the documentation for the entity for more details on the fields that can be searched, and the default fields to be searched if searchOn is not specified. (Optional)

  • :starts_with (Boolean)

    When true, the search will only return results that begin with the specified search string. Otherwise, any match of the search string will be returned as a result. Default is false. (Optional)

  • :ends_with (Boolean)

    When true, the search will only return results that end with the specified search string. Otherwise, any match of the search string will be returned as a result. Default is false. (Optional)

  • :is_regex (Boolean)

    When true, the provided search string will be regarded as a regular expression and the search will return results matching the regular expression. Default is false. (Optional)

  • :sort_on (String)

    Comma separated list of fields to sort on. This can also be input via Array Inputs (see above). (Optional)

  • :sort_order (String)

    Comma separated list of ordering. Possible values are 'ASC' and 'DESC'. Default is 'ASC'. If your sortOn contains multiple fields and you would like to order fields individually, you can pass in a comma separated list here (or use Array Inputs, see above). For example, if your sortOn contained 5 fields, and your sortOrder contained 'ASC, DESC, DESC', these would be applied to the first three items in the sortOn field. The remaining two would default to ASC. (Optional)

  • :account_id (String)

    The unique ID of the Account for which you want to find LSEs. When passed in, the search will look for a territoryId on the Account and use that to find all LSEs that provide service within that territory. (Optional)

Returns:

  • (Array)

    List of load serving entities.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



73
74
75
# File 'lib/genability/client/load_serving_entity.rb', line 73

def load_serving_entities(options={})
  get("public/lses", lses_params(options)).results
end

#load_serving_entity(load_serving_entity_id) ⇒ Hashie::Mash Also known as: lse

Returns details for a single load serving entity

Examples:

Return the details for Georgia Power Co

Genability.load_serving_entity(2756)

Parameters:

  • load_serving_entity_id (Integer)

    Unique Genability ID (primary key) for a Load Serving Entity.

Returns:

  • (Hashie::Mash)

    Details for a load serving entity.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



89
90
91
# File 'lib/genability/client/load_serving_entity.rb', line 89

def load_serving_entity(load_serving_entity_id)
  get("public/lses/#{load_serving_entity_id}").results.first
end