hsc

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateFS embed.FS

Functions

func GenerateObjectsClient

func GenerateObjectsClient(g *Graph) error

func GenerateObjectsTypeDefault

func GenerateObjectsTypeDefault(g *Graph) error

func GenreateObjectsType

func GenreateObjectsType(g *Graph) error

Types

type EndpointTarget

type EndpointTarget struct {
	// Name is the name of the endpoint target.
	//
	// It must be equal to an exported name in the endpoint package.
	//
	// Example: "Contacts" => github.com/marcozac/hubspot-go/endpoint.Contacts
	Name string

	// Package is the package of the endpoint target.
	//
	// Example: "github.com/marcozac/hubspot-go/endpoint"
	Package string
	// contains filtered or unexported fields
}

func (*EndpointTarget) Alias

func (et *EndpointTarget) Alias() string

Alias returns the alias of the endpoint target used for imports.

Since the alias may be altered by Graph, this method should be called only after [Graph.resolveImports] has been called or (better) in a template.

type Graph

type Graph struct {
	// OutDir is the output directory for the generated files.
	//
	// Default: "."
	OutDir string

	// PackageName is the name of the package for the generated files.
	//
	// Default: "hubspot"
	PackageName string

	// PackagePath is the path of the package for the generated files.
	//
	// Example: "github.com/marcozac/hubspot-go"
	PackagePath string

	// Imports is a map formatted as "path:alias" for the imports of the graph.
	Imports map[string]string

	// Objects is a list of objects of the node.
	Objects []*Object

	// Header is the header for the generated files.
	//
	// Default: "Code generated by hsc. DO NOT EDIT."
	Header string
	// contains filtered or unexported fields
}

func (*Graph) ImportHS

func (g *Graph) ImportHS() bool

ImportHS returns true if the types should imported from the hubspot-go package

func (*Graph) Init

func (g *Graph) Init() error

type Object

type Object struct {
	// Name is the name of the object.
	//
	// Example: "Contact"
	Name string

	// Properties is a list of properties of the object.
	Properties []*Property

	// Endpoint is the endpoint of the object.
	//
	// Example: "https://api.hubapi.com/crm/v3/objects/contacts"
	Endpoint string

	// EndpointTarget is the target endpoint for the object.
	//
	// It is used if [Object.Endpoint] is empty.
	EndpointTarget *EndpointTarget
	// contains filtered or unexported fields
}

func (*Object) ImportHS

func (o *Object) ImportHS() bool

ImportHS returns true if the types should imported from the hubspot-go package

type Property

type Property struct {
	*hubspot.Property
	// contains filtered or unexported fields
}

func (*Property) ImportHS

func (p *Property) ImportHS() bool

ImportHS returns true if the types should imported from the hubspot-go package

func (Property) IsDefault

func (p Property) IsDefault() bool

IsDefault returns true if the property is a HubSpot default property.

func (Property) StructFieldJSONTag

func (p Property) StructFieldJSONTag() string

func (*Property) StructFieldName

func (p *Property) StructFieldName() string

func (*Property) StructFieldType

func (p *Property) StructFieldType() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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