provider

package
v0.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2023 License: MPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(version string) func() provider.Provider

New is a helper function to simplify provider server and testing implementation.

func NewChargepointsDataSource

func NewChargepointsDataSource() datasource.DataSource

NewChargepointsDataSource is a helper function to simplify the provider implementation.

func NewOrganizationalUnitsDataSource added in v0.1.15

func NewOrganizationalUnitsDataSource() datasource.DataSource

func NewWebhookResource

func NewWebhookResource() resource.Resource

func NewWebhooksDataSource

func NewWebhooksDataSource() datasource.DataSource

Types

type AuthStruct

type AuthStruct struct {
	TenantKey      string
	ApplicationKey string
}

type Chargepoint

type Chargepoint struct {
	ID                    string `json:"id"`
	ChargepointID         string `json:"chargePointId"`
	DateDeleted           string `json:"dateDeleted"`
	DisplayName           string `json:"displayName"`
	RoamingName           string `json:"roamingName"`
	ChargeBoxSerialNumber string `json:"chargeBoxSerialNumber"`
	ChargepointVendor     string `json:"chargePointVendor"`
	Evses                 []Evse `json:"evses"`
}

type ChargepointDataSourceModel

type ChargepointDataSourceModel struct {
	ID                    types.String          `tfsdk:"id"`
	ChargepointID         types.String          `tfsdk:"chargepoint_id"`
	DateDeleted           types.String          `tfsdk:"date_deleted"`
	DisplayName           types.String          `tfsdk:"display_name"`
	RoamingName           types.String          `tfsdk:"roaming_name"`
	ChargeBoxSerialNumber types.String          `tfsdk:"charge_box_serial_number"`
	ChargepointVendor     types.String          `tfsdk:"chargepoint_vendor"`
	Evses                 []EvseDataSourceModel `tfsdk:"evses"`
}

type ChargepointsDataSource

type ChargepointsDataSource struct {
	// contains filtered or unexported fields
}

ChargepointsDataSource is the data source implementation.

func (*ChargepointsDataSource) Configure

Configure adds the provider configured client to the data source.

func (*ChargepointsDataSource) Metadata

Metadata returns the data source type name.

func (*ChargepointsDataSource) Read

Read refreshes the Terraform state with the latest data.

func (*ChargepointsDataSource) Schema

type ChargepointsDataSourceModel

type ChargepointsDataSourceModel struct {
	Chargepoints []ChargepointDataSourceModel `tfsdk:"chargepoints"`
}

type Client

type Client struct {
	HostURL    string
	HTTPClient *http.Client
	Auth       AuthStruct
}

func NewClient

func NewClient(host, tenantKey, applicationKey *string) (*Client, error)

func (*Client) CreateWebhook

func (c *Client) CreateWebhook(webhook WebhookConfig) (*WebhookResponse, error)

func (*Client) DeleteWebhook

func (c *Client) DeleteWebhook(id string) error

func (*Client) GetChargepoints

func (c *Client) GetChargepoints() ([]Chargepoint, error)

func (*Client) GetOrganizationalUnits added in v0.1.15

func (c *Client) GetOrganizationalUnits() ([]OrganizationalUnit, error)

func (*Client) GetWebhook

func (c *Client) GetWebhook(id string) (*WebhookResponse, error)

func (*Client) GetWebhooks

func (c *Client) GetWebhooks() ([]Webhook, error)

func (*Client) UpdateWebhook

func (c *Client) UpdateWebhook(id string, webhook WebhookConfig) (*WebhookResponse, error)

type Connector

type Connector struct {
	ID                 string `json:"id"`
	OperationalStatus  string `json:"operationalStatus"`
	Standard           string `json:"standard"`
	Format             string `json:"format"`
	PowerType          string `json:"powerType"`
	MaxVoltage         int64  `json:"maxVoltage"`
	MaxAmperage        int64  `json:"maxAmperage"`
	MaxElectricalPower int64  `json:"maxElectricalPower"`
}

type ConnectorDataSourceModel

type ConnectorDataSourceModel struct {
	ID                 types.String `tfsdk:"id"`
	OperationalStatus  types.String `tfsdk:"operational_status"`
	Standard           types.String `tfsdk:"standard"`
	Format             types.String `tfsdk:"format"`
	PowerType          types.String `tfsdk:"power_type"`
	MaxVoltage         types.Int64  `tfsdk:"max_voltage"`
	MaxAmperage        types.Int64  `tfsdk:"max_amperage"`
	MaxElectricalPower types.Int64  `tfsdk:"max_electrical_power"`
}

type Evse

type Evse struct {
	EvseID     string      `json:"evse_id"`
	Connectors []Connector `json:"connectors"`
}

type EvseDataSourceModel

type EvseDataSourceModel struct {
	EvseID     types.String               `tfsdk:"evse_id"`
	Connectors []ConnectorDataSourceModel `tfsdk:"connectors"`
}

type FinancialDetails added in v0.1.15

type FinancialDetails struct {
	BeneficiaryName string `json:"beneficiaryName"`
	IBAN            string `json:"iban"`
	BIC             string `json:"bic"`
}

type FinancialDetailsDataSourceModel added in v0.1.15

type FinancialDetailsDataSourceModel struct {
	BeneficiaryName types.String `tfsdk:"beneficiary_name"`
	IBAN            types.String `tfsdk:"iban"`
	BIC             types.String `tfsdk:"bic"`
}
type Header struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type HeaderModel

type HeaderModel struct {
	Name  types.String `tfsdk:"name"`
	Value types.String `tfsdk:"value"`
}

type OrganizationalUnit added in v0.1.15

type OrganizationalUnit struct {
	ID                        string           `json:"id"`
	ParentID                  string           `json:"parentId"`
	Name                      string           `json:"name"`
	Code                      string           `json:"code"`
	ExternalReference         string           `json:"external_reference"`
	GridOwnerReference        string           `json:"grid_owner_reference"`
	TenantReference           string           `json:"tenant_reference"`
	CustomerReference         string           `json:"customer_reference"`
	Address                   string           `json:"address"`
	State                     string           `json:"state"`
	Country                   string           `json:"country"`
	City                      string           `json:"city"`
	HouseNumber               string           `json:"house_number"`
	PostalCode                string           `json:"postal_code"`
	HotlinePhoneNumber        string           `json:"hotline_phone_number"`
	CompanyEmail              string           `json:"company_email"`
	PrimaryContactPerson      string           `json:"primary_contact_person"`
	PrimaryContactPersonEmail string           `json:"primary_contact_person_email"`
	DirectPaymentProfileId    string           `json:"direct_payment_profile_id"`
	MspOuID                   string           `json:"msp_ou_id"`
	MspOuName                 string           `json:"msp_ou_name"`
	MspOuCode                 string           `json:"msp_ou_code"`
	MspExternalID             string           `json:"msp_external_id"`
	FinancialDetails          FinancialDetails `json:"financialDetails"`
}

type OrganizationalUnitDataSourceModel added in v0.1.15

type OrganizationalUnitDataSourceModel struct {
	ID                        types.String                    `tfsdk:"id"`
	ParentID                  types.String                    `tfsdk:"parent_id"`
	Name                      types.String                    `tfsdk:"name"`
	Code                      types.String                    `tfsdk:"code"`
	ExternalReference         types.String                    `tfsdk:"external_reference"`
	GridOwnerReference        types.String                    `tfsdk:"grid_owner_reference"`
	TenantReference           types.String                    `tfsdk:"tenant_reference"`
	CustomerReference         types.String                    `tfsdk:"customer_reference"`
	Address                   types.String                    `tfsdk:"address"`
	State                     types.String                    `tfsdk:"state"`
	Country                   types.String                    `tfsdk:"country"`
	City                      types.String                    `tfsdk:"city"`
	HouseNumber               types.String                    `tfsdk:"house_number"`
	PostalCode                types.String                    `tfsdk:"postal_code"`
	HotlinePhoneNumber        types.String                    `tfsdk:"hotline_phone_number"`
	CompanyEmail              types.String                    `tfsdk:"company_email"`
	PrimaryContactPerson      types.String                    `tfsdk:"primary_contact_person"`
	PrimaryContactPersonEmail types.String                    `tfsdk:"primary_contact_person_email"`
	DirectPaymentProfileId    types.String                    `tfsdk:"direct_payment_profile_id"`
	MspOuID                   types.String                    `tfsdk:"msp_ou_id"`
	MspOuName                 types.String                    `tfsdk:"msp_ou_name"`
	MspOuCode                 types.String                    `tfsdk:"msp_ou_code"`
	MspExternalID             types.String                    `tfsdk:"msp_external_id"`
	FinancialDetails          FinancialDetailsDataSourceModel `tfsdk:"financial_details"`
}

type OrganizationalUnitsDataSource added in v0.1.15

type OrganizationalUnitsDataSource struct {
	// contains filtered or unexported fields
}

OrganizationalUnitsDataSource is the data source implementation.

func (*OrganizationalUnitsDataSource) Configure added in v0.1.15

Configure adds the provider configured client to the data source.

func (*OrganizationalUnitsDataSource) Metadata added in v0.1.15

Metadata returns the data source type name.

func (*OrganizationalUnitsDataSource) Read added in v0.1.15

func (*OrganizationalUnitsDataSource) Schema added in v0.1.15

type OrganizationalUnitsDataSourceModel added in v0.1.15

type OrganizationalUnitsDataSourceModel struct {
	OrganizationalUnits []OrganizationalUnitDataSourceModel `tfsdk:"organizational_units"`
}

type Webhook

type Webhook struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	OUCode     string   `json:"ouCode"`
	Enabled    bool     `json:"enabled"`
	EventTypes []string `json:"eventTypes"`
	URL        string   `json:"url"`
	Created    string   `json:"created"`
	Updated    string   `json:"updated"`
}

type WebhookConfig

type WebhookConfig struct {
	Name       string   `json:"name"`
	OUCode     string   `json:"ouCode"`
	Enabled    bool     `json:"enabled"`
	EventTypes []string `json:"eventTypes"`
	Headers    []Header `json:"headers"`
	URL        string   `json:"url"`
}

type WebhookDataSourceModel

type WebhookDataSourceModel struct {
	ID         types.String   `tfsdk:"id"`
	Name       types.String   `tfsdk:"name"`
	Enabled    types.Bool     `tfsdk:"enabled"`
	EventTypes []types.String `tfsdk:"event_types"`
	Created    types.String   `tfsdk:"created"`
	Updated    types.String   `tfsdk:"updated"`
}

type WebhookResourceModel

type WebhookResourceModel struct {
	ID         types.String   `tfsdk:"id"`
	Name       types.String   `tfsdk:"name"`
	OUCode     types.String   `tfsdk:"ou_code"`
	Enabled    types.Bool     `tfsdk:"enabled"`
	EventTypes []types.String `tfsdk:"event_types"`
	URL        types.String   `tfsdk:"url"`
	Headers    types.Map      `tfsdk:"headers"`
	Created    types.String   `tfsdk:"created"`
	Updated    types.String   `tfsdk:"updated"`
}

type WebhookResponse

type WebhookResponse struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	OUCode     string   `json:"ouCode"`
	Enabled    bool     `json:"enabled"`
	EventTypes []string `json:"eventTypes"`
	URL        string   `json:"url"`
	Headers    []Header `json:"headers"`
	Created    string   `json:"created"`
	Updated    string   `json:"updated"`
}

type WebhooksDataSource

type WebhooksDataSource struct {
	// contains filtered or unexported fields
}

WebhooksDataSource is the data source implementation.

func (*WebhooksDataSource) Configure

Configure adds the provider configured client to the data source.

func (*WebhooksDataSource) Metadata

Metadata returns the data source type name.

func (*WebhooksDataSource) Read

Read refreshes the Terraform state with the latest data.

func (*WebhooksDataSource) Schema

Schema defines the schema for the data source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL