From 7118197bb09e922e1df66db74d491f6839564d1f Mon Sep 17 00:00:00 2001 From: Adam Carlile Date: Tue, 8 Nov 2022 10:15:51 +0000 Subject: [PATCH] Commit Initial commit remove --- Gemfile.lock | 1 + README.md | 52 +++++++++++++++--- lib/cephalopod.rb | 43 ++++++++++++++- lib/cephalopod/models/charge.rb | 12 ++++ lib/cephalopod/models/consumption.rb | 11 ++++ lib/cephalopod/models/gsp.rb | 10 ++++ ...ctricity_meter_point.rb => meter_point.rb} | 2 +- lib/cephalopod/models/product.rb | 20 ++++--- lib/cephalopod/models/product_summary.rb | 35 ++++++++++++ .../models/products/dual_register_charge.rb | 26 +++++++++ .../models/products/single_register_charge.rb | 24 ++++++++ lib/cephalopod/repos/.DS_Store | Bin 0 -> 6148 bytes lib/cephalopod/repos/base.rb | 2 +- .../consumption/collection.rb | 16 ++++++ .../v1/electricity_meter_points/resource.rb | 14 +++++ .../consumption/collection.rb | 16 ++++++ .../repos/v1/gas_meter_points/resource.rb | 14 +++++ lib/cephalopod/repos/v1/gsp/resource.rb | 14 +++++ .../repos/v1/products/collection.rb | 6 +- lib/cephalopod/repos/v1/products/resource.rb | 2 +- .../electricity/day_unit_rates/collection.rb | 18 ++++++ .../night_unit_rates/collection.rb | 18 ++++++ .../standard_unit_rates/collection.rb | 18 ++++++ .../standing_charges/collection.rb | 18 ++++++ .../gas/standard_unit_rates/collection.rb | 18 ++++++ .../gas/standing_charges/collection.rb | 18 ++++++ 26 files changed, 406 insertions(+), 22 deletions(-) create mode 100644 lib/cephalopod/models/charge.rb create mode 100644 lib/cephalopod/models/consumption.rb create mode 100644 lib/cephalopod/models/gsp.rb rename lib/cephalopod/models/{electricity_meter_point.rb => meter_point.rb} (85%) create mode 100644 lib/cephalopod/models/product_summary.rb create mode 100644 lib/cephalopod/models/products/dual_register_charge.rb create mode 100644 lib/cephalopod/models/products/single_register_charge.rb create mode 100644 lib/cephalopod/repos/.DS_Store create mode 100644 lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb create mode 100644 lib/cephalopod/repos/v1/electricity_meter_points/resource.rb create mode 100644 lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb create mode 100644 lib/cephalopod/repos/v1/gas_meter_points/resource.rb create mode 100644 lib/cephalopod/repos/v1/gsp/resource.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb create mode 100644 lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb diff --git a/Gemfile.lock b/Gemfile.lock index 30f48c0..2fd92ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,7 @@ GEM concurrent-ruby (~> 1.0) PLATFORMS + arm64-darwin-21 x86_64-darwin-20 DEPENDENCIES diff --git a/README.md b/README.md index 16f2cdb..d01af96 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Cephalopod -Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/cephalopod`. To experiment with that code, run `bin/console` for an interactive prompt. - -TODO: Delete this and the text above, and describe your gem +Cephalopod is an Octopus, and also a gem designed to query the Octopus Energy REST API. ## Installation @@ -16,8 +14,48 @@ If bundler is not being used to manage dependencies, install the gem by executin ## Usage -TODO: Write usage instructions here - +### Configuration + +```ruby +Cephalopod.configure do |config| + config[:api_key] = "Your API key" + config[:base_url] = "https://api.octopus.energy" +end +``` + +You will need an Octopus API key, this can be generated from your customer dashboard: https://octopus.energy/dashboard/developer/ + +### Runtime + +Products and tariffs can be retrieved +```ruby +products = Cephalopod.products(query: {is_variable: true, available_at: DateTime.now}) +# Available query params: +# is_variable (boolean, optional) +# is_green (boolean, optional) +# is_tracker (boolean, optional) +# is_prepay (boolean, optional) +# is_business (boolean, default: false) +# available_at (datetime, default: now) + +detailed_product = products.first.details +``` +However to make sense of the tariffs that are available to you, you will need to determine your GSP (Grid Supply Point), which is a key like `_J`. These GSP's are based on your geographic location, as provided by a postcode lookup +```ruby +gsp = Cephalopod.grid_supply_point(postcode: "W1D 1NN") +``` + +You can also grab consumption data, if supported on your account +```ruby +electrical_consumption = Cephalopod.electrical_consumption(mpan: "MPAN", serial_number: "METER SERIAL", query: {}) +gas_consumption = Cephalopod.gas_consumption(mpan: "MPAN", serial_number: "METER SERIAL", query: {}) +# Available query params +# period_from (datetime, optional) +# period_to (datetime, optional) +# page_size (int, optional) +# order_by (string, optional) +# group_by (string, optional) +``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. @@ -26,7 +64,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cephalopod. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/cephalopod/blob/master/CODE_OF_CONDUCT.md). +Bug reports and pull requests are welcome on GitHub at https://github.com/adamcarlile/cephalopod. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/adamcarlile/cephalopod/blob/master/CODE_OF_CONDUCT.md). ## License @@ -34,4 +72,4 @@ The gem is available as open source under the terms of the [MIT License](https:/ ## Code of Conduct -Everyone interacting in the Cephalopod project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/cephalopod/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Cephalopod project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/adamcarlile/cephalopod/blob/master/CODE_OF_CONDUCT.md). diff --git a/lib/cephalopod.rb b/lib/cephalopod.rb index 881766c..da97bb4 100644 --- a/lib/cephalopod.rb +++ b/lib/cephalopod.rb @@ -3,7 +3,6 @@ require 'dry-struct' require 'faraday' require "mustermann" -require 'pry' require "cephalopod/version" @@ -13,10 +12,33 @@ require "cephalopod/models/base" require "cephalopod/models/link" +require "cephalopod/models/charge" +require "cephalopod/models/products/dual_register_charge" +require "cephalopod/models/products/single_register_charge" +require "cephalopod/models/product_summary" require "cephalopod/models/product" +require "cephalopod/models/meter_point" +require "cephalopod/models/consumption" +require "cephalopod/models/gsp" require "cephalopod/repos/base" require "cephalopod/repos/v1/products/collection" +require "cephalopod/repos/v1/products/resource" + +require "cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection" +require "cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection" +require "cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection" +require "cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection" +require "cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection" +require "cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection" + +require "cephalopod/repos/v1/electricity_meter_points/resource" +require "cephalopod/repos/v1/electricity_meter_points/consumption/collection" +require "cephalopod/repos/v1/gas_meter_points/resource" +require "cephalopod/repos/v1/gas_meter_points/consumption/collection" + +require "cephalopod/repos/v1/gsp/resource" + module Cephalopod class Error < StandardError; end @@ -29,11 +51,28 @@ def configure(&block) def config @config ||= { base_url: 'https://api.octopus.energy', - api_key: 'sk_live_w823Gn24vek120vYwZUBBPMp' + api_key: 'api_key' } end def client @client ||= Cephalopod::Adaptor.new(**config) end + + def products(*args) + Cephalopod::Repos::V1::Products::Collection.new.get(*args) + end + + def electrical_consumption(mpan:, serial_number:, **args) + Cephalopod::Repos::V1::ElectricityMeterPoints::Consumption::Collection.new.get(mpan: mpan, serial_number: serial_number, **args) + end + + def gas_consumption(mpan:, serial_number:, **args) + Cephalopod::Repos::V1::GasMeterPoints::Consumption::Collection.new.get(mpan: mpan, serial_number: serial_number, **args) + end + + def grid_supply_point(postcode:) + Cephalopod::Repos::V1::GSP::Resource.new.get(query: {postcode: postcode}) + end + end diff --git a/lib/cephalopod/models/charge.rb b/lib/cephalopod/models/charge.rb new file mode 100644 index 0000000..81f3658 --- /dev/null +++ b/lib/cephalopod/models/charge.rb @@ -0,0 +1,12 @@ +module Cephalopod + module Models + class Charge < Base + + attribute :value_exc_vat, Types::Strict::Float + attribute :value_inc_vat, Types::Strict::Float + attribute :valid_from, Types::JSON::DateTime + attribute :valid_to, Types::JSON::DateTime + + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/models/consumption.rb b/lib/cephalopod/models/consumption.rb new file mode 100644 index 0000000..68cbd8e --- /dev/null +++ b/lib/cephalopod/models/consumption.rb @@ -0,0 +1,11 @@ +module Cephalopod + module Models + class Consumption < Base + + attribute :consumption, Types::Strict::Float + attribute :interval_start, Types::JSON::DateTime + attribute :interval_end, Types::JSON::DateTime + + end + end +end diff --git a/lib/cephalopod/models/gsp.rb b/lib/cephalopod/models/gsp.rb new file mode 100644 index 0000000..f61c750 --- /dev/null +++ b/lib/cephalopod/models/gsp.rb @@ -0,0 +1,10 @@ +module Cephalopod + module Models + class GSP < Base + + attribute :group_id, Types::Strict::String + + end + end + end + \ No newline at end of file diff --git a/lib/cephalopod/models/electricity_meter_point.rb b/lib/cephalopod/models/meter_point.rb similarity index 85% rename from lib/cephalopod/models/electricity_meter_point.rb rename to lib/cephalopod/models/meter_point.rb index dacffc2..ebca26d 100644 --- a/lib/cephalopod/models/electricity_meter_point.rb +++ b/lib/cephalopod/models/meter_point.rb @@ -1,6 +1,6 @@ module Cephalopod module Models - class ElectricityMeterPoint < Base + class MeterPoint < Base attribute :gsp, Types::Strict::String attribute :mpan, Types::Strict::String diff --git a/lib/cephalopod/models/product.rb b/lib/cephalopod/models/product.rb index 882ebb1..4a45d31 100644 --- a/lib/cephalopod/models/product.rb +++ b/lib/cephalopod/models/product.rb @@ -3,7 +3,6 @@ module Models class Product < Base attribute :code, Types::Strict::String - attribute :direction, Types::Strict::String attribute :full_name, Types::Strict::String attribute :display_name, Types::Strict::String attribute :description, Types::Strict::String @@ -17,16 +16,19 @@ class Product < Base attribute :brand, Types::Strict::String attribute :available_from, Types::Params::DateTime attribute :available_to, Types::Params::DateTime.optional - attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link) + attribute :tariffs_active_at, Types::Params::DateTime.optional + attribute :single_register_electricity_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::SingleRegisterCharge)).optional + attribute :dual_register_electricity_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::DualRegisterCharge)).optional + attribute :single_register_gas_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::SingleRegisterCharge)).optional - # attribute :tariffs_active_at, Types::Params::DateTime.optional - # attribute :single_register_electricity_tariffs, Types::Params::Hash.map(Types::Strict::String, Types::Strict::String).optional + attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link) - private - - def full_resource - links.detect {|x| x.self? } - end + alias_method :variable?, :is_variable + alias_method :green?, :is_green + alias_method :tracker?, :is_tracker + alias_method :prepay?, :is_prepay + alias_method :business?, :is_business + alias_method :is_restricted?, :is_restricted end end diff --git a/lib/cephalopod/models/product_summary.rb b/lib/cephalopod/models/product_summary.rb new file mode 100644 index 0000000..5d4a5d1 --- /dev/null +++ b/lib/cephalopod/models/product_summary.rb @@ -0,0 +1,35 @@ +module Cephalopod + module Models + class ProductSummary < Base + + attribute :code, Types::Strict::String + attribute :direction, Types::Strict::String + attribute :full_name, Types::Strict::String + attribute :display_name, Types::Strict::String + attribute :description, Types::Strict::String + attribute :is_variable, Types::Strict::Bool + attribute :is_green, Types::Strict::Bool + attribute :is_tracker, Types::Strict::Bool + attribute :is_prepay, Types::Strict::Bool + attribute :is_business, Types::Strict::Bool + attribute :is_restricted, Types::Strict::Bool + attribute :term, Types::Integer.optional + attribute :brand, Types::Strict::String + attribute :available_from, Types::Params::DateTime + attribute :available_to, Types::Params::DateTime.optional + attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link) + + def details + @details ||= Cephalopod::Repos::V1::Products::Resource.new.get(code: code) + end + + alias_method :variable?, :is_variable + alias_method :green?, :is_green + alias_method :tracker?, :is_tracker + alias_method :prepay?, :is_prepay + alias_method :business?, :is_business + alias_method :is_restricted?, :is_restricted + + end + end +end diff --git a/lib/cephalopod/models/products/dual_register_charge.rb b/lib/cephalopod/models/products/dual_register_charge.rb new file mode 100644 index 0000000..85426db --- /dev/null +++ b/lib/cephalopod/models/products/dual_register_charge.rb @@ -0,0 +1,26 @@ +module Cephalopod + module Models + module Products + class DualRegisterCharge < Base + + attribute :code, Types::Strict::String + attribute :standing_charge_exc_vat, Types::Coercible::Float + attribute :standing_charge_inc_vat, Types::Coercible::Float + attribute :online_discount_exc_vat, Types::Coercible::Float + attribute :online_discount_inc_vat, Types::Coercible::Float + attribute :dual_fuel_discount_exc_vat, Types::Coercible::Float + attribute :dual_fuel_discount_inc_vat, Types::Coercible::Float + attribute :exit_fees_exc_vat, Types::Coercible::Float + attribute :exit_fees_inc_vat, Types::Coercible::Float + attribute :exit_fees_type, Types::Strict::String + attribute :day_unit_rate_exc_vat, Types::Coercible::Float + attribute :day_unit_rate_inc_vat, Types::Coercible::Float + attribute :night_unit_rate_exc_vat, Types::Coercible::Float + attribute :night_unit_rate_inc_vat, Types::Coercible::Float + + attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link) + + end + end + end +end diff --git a/lib/cephalopod/models/products/single_register_charge.rb b/lib/cephalopod/models/products/single_register_charge.rb new file mode 100644 index 0000000..0e79e9c --- /dev/null +++ b/lib/cephalopod/models/products/single_register_charge.rb @@ -0,0 +1,24 @@ +module Cephalopod + module Models + module Products + class SingleRegisterCharge < Base + + attribute :code, Types::Strict::String + attribute :standing_charge_exc_vat, Types::Coercible::Float + attribute :standing_charge_inc_vat, Types::Coercible::Float + attribute :online_discount_exc_vat, Types::Coercible::Float + attribute :online_discount_inc_vat, Types::Coercible::Float + attribute :dual_fuel_discount_exc_vat, Types::Coercible::Float + attribute :dual_fuel_discount_inc_vat, Types::Coercible::Float + attribute :exit_fees_exc_vat, Types::Coercible::Float + attribute :exit_fees_inc_vat, Types::Coercible::Float + attribute :exit_fees_type, Types::Strict::String + attribute :standard_unit_rate_exc_vat, Types::Coercible::Float + attribute :standard_unit_rate_inc_vat, Types::Coercible::Float + + attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link) + + end + end + end +end diff --git a/lib/cephalopod/repos/.DS_Store b/lib/cephalopod/repos/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b84036a91cee492d575aa6e3fda097b5c1db4e47 GIT binary patch literal 6148 zcmeH~F%H5o3`K3|fW*>~F$)La22lkk=mi*%SWuCW=$xbT?RX(DqY8aX_KTfbZU4~J zBBI0dauDf7WCJ(K-a=!Fd?m9S=J7Gz?$Z^y)y!5Eo}<=Fvme_86`%rCfC^9nDzG30 z;vC;>7xYYg6e>UkmZ5-s9}?V{gQe0x9SA-GfE~(iSogTB1y1+rd9O3OJ0Er#NJGdM6lP$m;ES0Fh_#@ylFi?S?D)0h_ Cc@Pf( literal 0 HcmV?d00001 diff --git a/lib/cephalopod/repos/base.rb b/lib/cephalopod/repos/base.rb index 8344793..51f4ccf 100644 --- a/lib/cephalopod/repos/base.rb +++ b/lib/cephalopod/repos/base.rb @@ -34,7 +34,7 @@ def initialize(client: Cephalopod.client, end def get(method: :get, headers: {}, query: {}, body: nil, **params, &block) - parse_response(@client.run_request(method, build_path(query: query, **params), body, headers, &block)) + @get ||= parse_response(@client.run_request(method, build_path(query: query, **params), body, headers, &block)) end private diff --git a/lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb b/lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb new file mode 100644 index 0000000..ff0720b --- /dev/null +++ b/lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb @@ -0,0 +1,16 @@ +module Cephalopod + module Repos + module V1 + module ElectricityMeterPoints + module Consumption + class Collection < Base + + model Cephalopod::Models::Consumption + resource_route '/v1/electricity-meter-points/:mpan/meters/:serial_number/consumption/' + + end + end + end + end + end + end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/electricity_meter_points/resource.rb b/lib/cephalopod/repos/v1/electricity_meter_points/resource.rb new file mode 100644 index 0000000..94c76f5 --- /dev/null +++ b/lib/cephalopod/repos/v1/electricity_meter_points/resource.rb @@ -0,0 +1,14 @@ +module Cephalopod + module Repos + module V1 + module ElectricityMeterPoints + class Resource < Base + + model Cephalopod::Models::MeterPoint + resource_route '/v1/electricity-meter-points/:mpan/' + + end + end + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb b/lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb new file mode 100644 index 0000000..e8f2faa --- /dev/null +++ b/lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb @@ -0,0 +1,16 @@ +module Cephalopod + module Repos + module V1 + module GasMeterPoints + module Consumption + class Collection < Base + + model Cephalopod::Models::Consumption + resource_route '/v1/gas-meter-points/:mpan/meters/:serial_number/consumption/' + + end + end + end + end + end + end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/gas_meter_points/resource.rb b/lib/cephalopod/repos/v1/gas_meter_points/resource.rb new file mode 100644 index 0000000..b6f7975 --- /dev/null +++ b/lib/cephalopod/repos/v1/gas_meter_points/resource.rb @@ -0,0 +1,14 @@ +module Cephalopod + module Repos + module V1 + module GasMeterPoints + class Resource < Base + + model Cephalopod::Models::MeterPoint + resource_route '/v1/gas-meter-points/:mpan/' + + end + end + end + end + end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/gsp/resource.rb b/lib/cephalopod/repos/v1/gsp/resource.rb new file mode 100644 index 0000000..9e3e65e --- /dev/null +++ b/lib/cephalopod/repos/v1/gsp/resource.rb @@ -0,0 +1,14 @@ +module Cephalopod + module Repos + module V1 + module GSP + class Resource < Base + + model Cephalopod::Models::GSP + resource_route '/v1/industry/grid-supply-points/' + + end + end + end + end + end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/collection.rb b/lib/cephalopod/repos/v1/products/collection.rb index 5726614..e4bf3b8 100644 --- a/lib/cephalopod/repos/v1/products/collection.rb +++ b/lib/cephalopod/repos/v1/products/collection.rb @@ -4,9 +4,13 @@ module V1 module Products class Collection < Base - model Cephalopod::Models::Product + model Cephalopod::Models::ProductSummary resource_route '/v1/products/' + def variable + select(:variable?) + end + end end end diff --git a/lib/cephalopod/repos/v1/products/resource.rb b/lib/cephalopod/repos/v1/products/resource.rb index 26a01c8..a5e5767 100644 --- a/lib/cephalopod/repos/v1/products/resource.rb +++ b/lib/cephalopod/repos/v1/products/resource.rb @@ -5,7 +5,7 @@ module Products class Resource < Base model Cephalopod::Models::Product - resource_route '/v1/products/:code' + resource_route '/v1/products/:code/' end end diff --git a/lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb new file mode 100644 index 0000000..189e02f --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Electricity + module DayUnitRates + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/day-unit-rates/' + + end + end + end + end + end + end + end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb new file mode 100644 index 0000000..279c9cc --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Electricity + module NightUnitRates + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/night-unit-rates/' + + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb new file mode 100644 index 0000000..acba5de --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Electricity + module StandardUnitRates + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/standard-unit-rates/' + + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb new file mode 100644 index 0000000..da82f6b --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Electricity + module StandingCharges + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/standing-charges/' + + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb new file mode 100644 index 0000000..dc01c27 --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Gas + module StandardUnitRates + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/gas-tariffs/:tariff_code/standard-unit-rates/' + + end + end + end + end + end + end +end \ No newline at end of file diff --git a/lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb b/lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb new file mode 100644 index 0000000..b30ca89 --- /dev/null +++ b/lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb @@ -0,0 +1,18 @@ +module Cephalopod + module Repos + module V1 + module Tariffs + module Gas + module StandingCharges + class Collection < Base + + model Cephalopod::Models::Charge + resource_route '/v1/products/:product_code/gas-tariffs/:tariff_code/standing-charges/' + + end + end + end + end + end + end +end \ No newline at end of file