deals

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package deals covers the Deals API which has been exposed to allow for easy integration with the HubSpot CRM objects.

Package deals covers the Deals API which has been exposed to allow for easy integration with the HubSpot CRM objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Associations

type Associations struct {
	AssociatedVids       []int64       `json:"associatedVids"`
	AssociatedCompanyIDS []interface{} `json:"associatedCompanyIds"`
	AssociatedDealIDS    []interface{} `json:"associatedDealIds"`
	AssociatedTicketIDS  []interface{} `json:"associatedTicketIds"`
}

Associations is a struct generated from the HubSpot API

type Deal

type Deal struct {
	PortalID     int64               `json:"portalId"`
	DealID       int64               `json:"dealId"`
	IsDeleted    bool                `json:"isDeleted"`
	Associations Associations        `json:"associations"`
	Properties   map[string]Property `json:"properties"`
	Imports      []interface{}       `json:"imports"`
	StateChanges []interface{}       `json:"stateChanges"`
}

Deal is a struct generated from the HubSpot API

type Deals

type Deals struct {
	*client.Client
	Count  int64
	OffSet int64
}

Deals contains the elements to communicate with the HubSpot Deals endpoints.

func New

func New(c *client.Client) *Deals

New creates a new instance of the Deals service with default settings.

func (*Deals) GetDeal

func (d *Deals) GetDeal(dealID string) (Deal, error)

GetDeal returns an object representing the deal with the id :dealId associated with the specified account.

func (*Deals) GetRecentlyModifiedDeals

func (d *Deals) GetRecentlyModifiedDeals() ([]Result, error)

GetRecentlyModifiedDeals gets recently modified deals in an account sorted by their last modified date, starting with the most recently modified deals.

func (*Deals) UpdateDeal

func (d *Deals) UpdateDeal(dealID string, props map[string]string) error

UpdateDeal is to update an existing deal in HubSpot. This method lets you update the properties of a deal in HubSpot. The map[string]string represents the new values for the contact, where the map key is the name of the property and the map value is the new value

func (*Deals) WithOffSet

func (d *Deals) WithOffSet(offset int64) *Deals

WithOffSet sets an offset value returning a Deals pointer for chaining.

type Properties

type Properties struct {
	Properties []Property `json:"properties"`
}

Properties is a struct generated from the HubSpot API

func (*Properties) Marshal

func (r *Properties) Marshal() ([]byte, error)

Marshal takes an Properties struct and transforms it into a byte array

type Property

type Property struct {
	Name      string    `json:"name,omitempty"`
	Value     string    `json:"value"`
	Timestamp int64     `json:"timestamp,omitempty"`
	Source    string    `json:"source,omitempty"`
	SourceID  string    `json:"sourceId,omitempty"`
	Versions  []Version `json:"versions,omitempty"`
}

Property is a struct generated from the HubSpot API

type RecentDeals

type RecentDeals struct {
	Results []Result `json:"results"`
	HasMore bool     `json:"hasMore"`
	Offset  int64    `json:"offset"`
	Total   int64    `json:"total"`
}

RecentDeals is a struct generated from the HubSpot API

type Result

type Result struct {
	PortalID     int64               `json:"portalId"`
	DealID       int64               `json:"dealId"`
	IsDeleted    bool                `json:"isDeleted"`
	Associations Associations        `json:"associations"`
	Properties   map[string]Property `json:"properties"`
	Imports      []interface{}       `json:"imports"`
	StateChanges []interface{}       `json:"stateChanges"`
}

Result is a struct generated from the HubSpot API

type Version

type Version struct {
	Name      string        `json:"name"`
	Value     string        `json:"value"`
	Timestamp int64         `json:"timestamp"`
	SourceID  string        `json:"sourceId,omitempty"`
	Source    string        `json:"source"`
	SourceVid []interface{} `json:"sourceVid"`
}

Version is a struct generated from the HubSpot API

Jump to

Keyboard shortcuts

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