domains

package
v0.0.0-...-d74374d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDomainsInto

func ExtractDomainsInto(r pagination.Page, v interface{}) error

func List

List returns a Pager which allows you to iterate over a collection of domains.

Types

type CostObject

type CostObject struct {
	// Set to true, if the costobject should be inheritable for subprojects
	ProjectsCanInherit bool `json:"projects_can_inherit"`
	// Name of the costobject
	Name string `json:"name,omitempty"`
	// Costobject-Type Type of the costobject
	// IO, CC, WBS, SO
	Type string `json:"type,omitempty"`
}

The cost object structure

type Domain

type Domain struct {
	// Instance ID
	IID int `json:"iid"`
	// ID of the domain
	DomainID string `json:"domain_id"`
	// Name of the domain
	DomainName string `json:"domain_name"`
	// Description of the domain
	Description string `json:"description"`
	// SAP-User-Id of primary contact for the domain
	ResponsiblePrimaryContactID string `json:"responsible_primary_contact_id"`
	// Email-address of primary contact for the domain
	ResponsiblePrimaryContactEmail string `json:"responsible_primary_contact_email"`
	// Freetext field for additional information for domain
	AdditionalInformation string `json:"additional_information"`
	// The cost object structure
	CostObject CostObject `json:"cost_object"`
	// The date, when the domain was created.
	CreatedAt time.Time `json:"-"`
	// The date, when the domain was updated.
	ChangedAt time.Time `json:"-"`
	// The ID of the user, who did the last change.
	ChangedBy string `json:"changed_by"`
	// Only contained in Server response: True, if the given masterdata are complete; Otherwise false
	IsComplete bool `json:"is_complete"`
	// Only contained in Server response: Human readable text, showing, what information are missing
	MissingAttributes string `json:"missing_attributes"`
	// Collector of the domain
	Collector string `json:"collector"`
	// Region of the domain
	Region string `json:"region"`
}

Domain represents a Billing Domain.

func ExtractDomains

func ExtractDomains(r pagination.Page) ([]Domain, error)

ExtractDomains accepts a Page struct, specifically a DomainPage struct, and extracts the elements into a slice of Domain structs. In other words, a generic collection is mapped into a relevant slice.

func (*Domain) UnmarshalJSON

func (r *Domain) UnmarshalJSON(b []byte) error

type DomainPage

type DomainPage struct {
	pagination.SinglePageBase
}

DomainPage is the page returned by a pager when traversing over a collection of domains.

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Domain.

func Get

func Get(c *gophercloud.ServiceClient, id string) (r GetResult)

Get retrieves a specific domain based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Domain, error)

Extract is a function that accepts a result and extracts a domain resource.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type ListOpts

type ListOpts struct {
	CheckCOValidity bool      `q:"checkCOValidity"`
	ExcludeDeleted  bool      `q:"excludeDeleted"`
	From            time.Time `q:"-"`
}

ListOpts is a structure that holds options for listing domain masterdata.

func (ListOpts) ToDomainListQuery

func (opts ListOpts) ToDomainListQuery() (string, error)

ToDomainListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToDomainListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request

type UpdateOpts

type UpdateOpts struct {
	// ID of the domain
	DomainID string `json:"domain_id,omitempty"`
	// Name of the domain
	DomainName string `json:"domain_name,omitempty"`
	// Description of the domain
	Description string `json:"description"`
	// SAP-User-Id of primary contact for the domain
	ResponsiblePrimaryContactID string `json:"responsible_primary_contact_id"`
	// Email-address of primary contact for the domain
	ResponsiblePrimaryContactEmail string `json:"responsible_primary_contact_email"`
	// Freetext field for additional information for domain
	AdditionalInformation string `json:"additional_information"`
	// The cost object structure
	CostObject CostObject `json:"cost_object" required:"true"`
	// Collector of the domain
	Collector string `json:"collector"`
	// Region of the domain
	Region string `json:"region"`
}

UpdateOpts represents the attributes used when updating an existing domain.

func DomainToUpdateOpts

func DomainToUpdateOpts(domain *Domain) UpdateOpts

func (UpdateOpts) ToDomainUpdateMap

func (opts UpdateOpts) ToDomainUpdateMap() (map[string]interface{}, error)

ToDomainUpdateMap builds a request body from UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToDomainUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult represents the result of an update operation. Call its Extract method to interpret it as a Domain.

func Update

Update accepts a UpdateOpts struct and updates an existing domain using the values provided.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*Domain, error)

Extract is a function that accepts a result and extracts a domain resource.

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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