smartsheet

package
v0.0.0-...-8344725 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Id                 int       // Attachment Id
	ParentId           int       // The Id of the parent
	AttachmentType     string    // Attachment type (one of BOX_COM, DROPBOX*, EGNYTE*, EVERNOTE*, FILE, GOOGLE_DRIVE, LINK, or ONEDRIVE) *Not supported for all account types, see below.
	AttachmentSubType  string    // Attachment sub type, valid only for the following:
	MimeType           string    // Attachment MIME type (PNG, etc.)
	ParentType         string    // The type of object the attachment belongs to (one of COMMENT, ROW, or SHEET)
	CreatedAt          time.Time // A timestamp of when the attachment was originally added
	CreatedBy          User      // User object containing name and email of the creator of this attachment
	Name               string    // Attachment name
	SizeInKb           int       // The size of the file, if the attachmentType is FILE
	Url                string    // Attachment temporary URL (files only)
	UrlExpiresInMillis int       // Attachment temporary URL time to live (files only)
}

type AutoNumberFormat

type AutoNumberFormat struct {
	Fill           string `json:"fill"`           // Indicates zero-padding. Must be between 0 and 10 "0" (zero) characters.
	Prefix         string `json:"prefix"`         // The prefix. Can include the date tokens:
	StartingNumber int    `json:"startingNumber"` // The starting number for the auto-id
	Suffix         string `json:"suffix"`         // The suffix. Can include the date tokens:
}

type BulkItemFailure

type BulkItemFailure struct {
	RowId int         `json:"rowId"` // The id of the Row that failed. Applicable only to bulk row operations
	Error ErrorObject `json:"error"` // The error caused by the failed item
	Index int         `json:"index"` // The index of the failed item in the bulk request array
}

type Cell

type Cell struct {
	CellHistory
	ColumnId           int64        `json:"columnId,omitempty"`           //The Id of the column that the cell is located in
	ColumnType         string       `json:"columnType,omitempty"`         //See type definition on the Column object. Only returned if the include query string parameter contains columnType.
	ConditionalFormat  string       `json:"conditionalFormat,omitempty"`  //The format descriptor describing this cell's conditional format (see Formatting). Only returned if the include query string parameter contains format and this cell has a conditional format applied.
	DisplayValue       string       `json:"displayValue,omitempty"`       //Visual representation of cell contents, as presented to the user in the UI. See Cell Reference.
	Format             string       `json:"format,omitempty"`             //The format descriptor (see Formatting) Only returned if the include query string parameter contains format and this cell has a non-default format applied.
	Formula            string       `json:"formula,omitempty"`            //The formula for a cell, if set, for instance =COUNTM([Assigned To]3). NOTE: calculation errors or problems with a formula do not cause the API call to return an error code. Instead, the response contains the same value as in the UI, such as cell.value = "#CIRCULAR REFERENCE".
	Hyperlink          *Hyperlink   `json:"hyperlink,omitempty"`          //A hyperlink to a URL, sheet, or report
	Image              *Image       `json:"image,omitempty"`              //The image that the cell contains. Only returned if the cell contains an image.
	LinkInFromCell     *CellLink    `json:"linkInFromCell,omitempty"`     //An inbound link from a cell in another sheet. This cell's value mirrors the linked cell's value.
	LinksOutToCells    []CellLink   `json:"linksOutToCells,omitempty"`    //An array of CellLink objects. Zero or more outbound links from this cell to cells in other sheets whose values mirror this cell's value.
	ObjectValue        *ObjectValue `json:"objectValue,omitempty"`        //Optionally included object representation of the cell's value. Used for updating predecessor cell values or for multi-contact details.
	OverrideValidation bool         `json:"overrideValidation,omitempty"` //(Admin only) Indicates whether the cell value can contain a value outside of the validation limits (value = true). When using this parameter, you must also set strict to false to bypass value type checking. This property is honored for POST or PUT actions that update rows.
	Strict             *bool        `json:"strict,omitempty"`             //Set to false to enable lenient parsing. Defaults to true. You can specify this attribute in a request, but it is never present in a response. See Cell Value Parsing for more information about using this attribute.
	Value              interface{}  `json:"value,omitempty"`              //string number, or Boolean 	A string, a number, or a Boolean value -- depending on the cell type and the data in the cell. Cell values larger than 4000 characters are silently truncated. An empty cell returns no value. See Cell Reference.
}

type CellHistory

type CellHistory struct {
	ModifiedAt *time.Time `json:"modifiedAt,omitempty"`
	ModifiedBy *User      `json:"modifiedBy,omitempty"`
}
type CellLink struct {
	ColumnId  int64  `json:"columnId,omitempty"`  // Column Id of the linked cell
	RowId     int    `json:"rowId,omitempty"`     // Row Id of the linked cell
	SheetId   int    `json:"sheetId,omitempty"`   // Sheet Id of the sheet that the linked cell belongs to
	SheetName string `json:"sheetName,omitempty"` // Sheet name of the linked cell
	Status    string `json:"status,omitempty"`
}

type Client

type Client struct {
	AuthToken   string
	APIEndpoint string
	HTTPClient  http.Client
}

func NewSmartsheetClient

func NewSmartsheetClient(options *ClientOptions) *Client

func (Client) AddRow

func (c Client) AddRow(sheetId int64, rows []Row) (*[]Row, error)

Return ResultObject object

func (Client) CreateSheet

func (c Client) CreateSheet(sheet Sheet) (*ResultObject, error)

Return ResultObject object

func (Client) CreateSheetInFolder

func (c Client) CreateSheetInFolder(folderId int, sheet Sheet) (*ResultObject, error)

Return ResultObject object

func (Client) CreateSheetInWorkspace

func (c Client) CreateSheetInWorkspace(workspaceId int, sheet Sheet) (*ResultObject, error)

Return ResultObject object

func (Client) DeleteSheet

func (c Client) DeleteSheet(id string) (*ResultObject, error)

Return ResultObject object

func (Client) GetColumnByName

func (c Client) GetColumnByName(sheetId int64, columnName string) (*Column, error)

Return ResultObject object

func (Client) GetSheet

func (c Client) GetSheet(id string) (*Sheet, error)

Return Sheet object

func (Client) GetWebhooks

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

Return IndexResultObject object

func (Client) UpdateSheet

func (c Client) UpdateSheet(id string, sheet Sheet) (*ResultObject, error)

Return ResultObject object

type ClientOptions

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

type Column

type Column struct {
	Id               int64            `json:"id"`               // Column Id
	SystemColumnType string           `json:"systemColumnType"` // When applicable, one of: AUTO_NUMBER, CREATED_BY, CREATED_DATE, MODIFIED_BY, MODIFIED_DATE. See System Columns.
	Type             string           `json:"type"`             // Column type
	AutoNumberFormat AutoNumberFormat `json:"autoNumberFormat"` // Present when systemColumnType == AUTO_NUMBER
	ContactOptions   []ContactOption  `json:"contactOptions"`   // Array of ContactOption objects to specify a pre-defined list of values for the column. Column type must be CONTACT_LIST
	Description      string           `json:"description"`      // Column description.
	Format           string           `json:"format"`           // The format descriptor (see Formatting). Only returned if the include query string parameter contains format and this column has a non-default format applied to it.
	Hidden           bool             `json:"hidden"`           // Indicates whether the column is hidden
	Index            int64            `json:"index"`            // Column index or position. This number is zero-based.
	Locked           bool             `json:"locked"`           // Indicates whether the column is locked. In a response, a value of true indicates that the column has been locked by the sheet owner or the admin.
	LockedForUser    bool             `json:"lockedForUser"`    // Indicates whether the column is locked for the requesting user. This attribute may be present in a response, but cannot be specified in a request.
	Options          []string         `json:"options"`          // Array of the options available for the column
	Primary          bool             `json:"primary"`          // Returned only if the column is the Primary Column (value = true)
	Symbol           string           `json:"symbol"`           // When applicable for CHECKBOX or PICKLIST column types. See Symbol Columns.
	Tags             []string         `json:"tags"`             // Set of tags to indicate special columns. Each element in the array is set to one of the following values:
	Title            string           `json:"title"`            // Column title
	Validation       bool             `json:"validation"`       // Indicates whether validation has been enabled for the column (value = true)
	Version          int              `json:"version"`          // Read only. The level of the column type. Each element in the array is set to one of the following values:
	Width            int              `json:"width"`            // Display width of the column in pixels
}

type Comment

type Comment struct {
	Id           int          // Comment Id
	DiscussionId int          // (optional) 	Discussion Id
	Attachments  []Attachment // Array of Attachment objects
	CreatedAt    time.Time    // Time of creation
	CreatedBy    User         // User object containing name and email of the comment's author
	ModifiedAt   time.Time    // Time of last modification
	Text         string       // Comment body
}

type ContactOption

type ContactOption struct {
	Email string `json:"email"` // A parsable email address.
	Name  string `json:"name"`  // Can be a user's name, display name, or free text, such as a job class or TBD.
}

type CrossSheetReference

type CrossSheetReference struct {
	Id            int64  `json:"id"`            // Cross-sheet reference Id, guaranteed unique within referencing sheet.
	EndColumnId   int64  `json:"endColumnId"`   // Defines ending edge of range when specifying one or more columns. To specify an entire column, omit the startRowId and endRowId parameters.
	EndRowId      int64  `json:"endRowId"`      // Defines ending edge of range when specifying one or more rows. To specify an entire row, omit the startColumnId and endColumnId parameters.
	SourceSheetId int64  `json:"sourceSheetId"` // Sheet Id of source sheet.
	StartColumnId int64  `json:"startColumnId"` // Defines beginning edge of range when specifying one or more columns. To specify an entire column, omit the startRowId and endRowId parameters.
	StartRowId    int64  `json:"startRowId"`    // Defines beginning edge of range when specifying one or more rows. To specify an entire row, omit the startColumnId and endColumnId parameters.
	Name          string `json:"name"`          // Friendly name of reference. Auto-generated unless specified in Create Cross-sheet References.
	Status        string `json:""`
}

type Discussion

type Discussion struct {
	Id                 int          // Discussion Id
	ParentId           int          // Id of the directly associated row or sheet: present only when the direct association is not clear (see List Discussions)
	ParentType         string       // SHEET or ROW: present only when the direct association is not clear (see List Discussions)
	AccessLevel        string       // User's permissions on the discussion
	CommentAttachments []Attachment // Array of Attachment objects
	CommentCount       int          // The number of comments in the discussion
	Comments           []Comment    // Array of Comment objects
	CreatedBy          User         // User object containing name and email of the creator of the discussion
	LastCommentedAt    time.Time    // Time of most recent comment
	LastCommentedUser  User         // User object containing name and email of the author of the most recent comment
	ReadOnly           bool         // Indicates whether the user can modify the discussion
	Title              string       // Read Only. Discussion title automatically created by duplicating the first 100 characters of the top-level comment
}

type ErrorObject

type ErrorObject struct {
	ErrorCode int    `json:"errorCode"`
	RefId     string `json:"refId"`
	Message   string `json:"message"`
}

type Folder

type Folder struct {
	Id        int        `json:"id"`        // Folder Id
	Favorite  bool       `json:"favorite"`  // Returned only if the user has marked the folder as a favorite in their "Home" tab (value = true)
	Folders   []Folder   `json:"folders"`   // Array of Folder objects
	Name      string     `json:"name"`      // Folder name
	Permalink string     `json:"permalink"` // URL that represents a direct link to the folder in Smartsheet
	Reports   []Report   `json:"reports"`   // Array of Report objects
	Sheets    []Sheet    `json:"sheets"`    // Array of Sheet objects
	Sights    []Sight    `json:"sights"`    // Array of Sight objects
	Templates []Template `json:"templates"` // Array of Template objects
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}
type Hyperlink struct {
	ReportId int    `json:"reportId,omitempty"` // If non-null, this hyperlink is a link to the report with this Id.
	SheetId  int    `json:"sheetId,omitempty"`  // If non-null, this hyperlink is a link to the sheet with this Id.
	SightId  int    `json:"sightId,omitempty"`  // If non-null, this hyperlink is a link to the Sight with this Id.
	Url      string `json:"url,omitempty"`      // When the hyperlink is a URL link, this property contains the URL value. When the hyperlink is a sheet/report/Sight link (that is, sheetId, reportId, or sightId is non-null), this property contains the permalink to the sheet, report, or Sight.
}

type Image

type Image struct {
	Id      string `json:"id,omitempty"`      // Image Id
	AltText string `json:"altText,omitempty"` // Alternate text for the image
	Height  int    `json:"height,omitempty"`  // Original height (in pixels) of the uploaded image
	Width   int    `json:"width,omitempty"`   // Original width (in pixels) of the uploaded image
}

type IndexResultObject

type IndexResultObject struct {
	Data       []interface{} `json:"data"`
	PageNumber int           `json:"pageNumber"` //The current page in the full result set that the data array represents. NOTE: when a page number greater than totalPages is requested, the last page is instead returned.
	PageSize   int           `json:"pageSize"`   //The number of items in a page. Omitted if there is no limit to page size (and hence, all results are included). Unless otherwise specified, this defaults to 100 for most endpoints.
	TotalCount int           `json:"totalCount"` //The total number of items in the full result set.
	TotalPages int           `json:"totalPages"` //The total number of pages in the full result set.
}

type ObjectValue

type ObjectValue struct {
	ObjectType string `json:"objectType,omitempty"`
}

type ProjectSettings

type ProjectSettings struct {
	LengthOfDay    float64  `json:"lengthOfDay"`    // Length of a workday for a project sheet. Valid value must be above or equal to 1 hour, and less than or equal to 24 hours.
	NonWorkingDays []string `json:"nonWorkingDays"` // Non-working days for a project sheet. The format for the timestamp array must be an array of strings that are valid ISO-8601 dates ('YYYY-MM-DD').
	WorkingDays    []string `json:"workingDays"`    // Working days of a week for a project sheet. Valid values must be an array of strings of days of the week: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, or SUNDAY
}

type Report

type Report struct {
	Scope        Scope   `json:"scope"`        // A report's scope can be defined as the sheet ids and workspace ids that make up the report.
	SourceSheets []Sheet `json:"sourceSheets"` // Array of Sheet objects (without rows), representing the sheets that rows in the report originated from. Only included in the Get Report response if the include parameter specifies sourceSheets.
}

type ResultObject

type ResultObject struct {
	FailedItems []BulkItemFailure `json:"failedItems"` //Array of BulkItemFailure objects which represents the items that failed to be added or updated. See Partial Success for more information. Applicable only for bulk operations that support partial success
	Message     string            `json:"message"`     // Message that indicates the outcome of the request. (One of SUCCESS or PARTIAL_SUCCESS)
	ResultCode  int               `json:"resultCode"`  //0 (zero) if successful, 3 for partial success of a bulk operation.
	Version     int               `json:"version"`     // New version of the Sheet. Applicable only for operations which update sheet data
	Result      interface{}       `json:"result"`
}

type Row

type Row struct {
	Id                int64        `json:"id,omitempty"`                // Row Id
	SheetId           int64        `json:"sheetId,omitempty"`           // Parent sheet Id
	AccessLevel       string       `json:"accessLevel,omitempty"`       // User's permission level on the sheet that contains the row
	Attachments       []Attachment `json:"attachments,omitempty"`       // Array of Attachment objects. Only returned if the include query string parameter contains attachments.
	Cells             []Cell       `json:"cells"`                       // Array of Cell objects belonging to the row
	Columns           []Column     `json:"columns,omitempty"`           // Array of Column objects. Only returned if the Get Row include query string parameter contains columns.
	ConditionalFormat string       `json:"conditionalFormat,omitempty"` // Describes this row's conditional format (see Formatting). Only returned if the include query string parameter contains format and this row has a conditional format applied.
	CreatedAt         *time.Time   `json:"createdAt,omitempty"`         // Time of creation
	CreatedBy         *User        `json:"createdBy,omitempty"`         // User object containing name and email of the creator of this row
	Discussions       []Discussion `json:"discussions,omitempty"`       // Array of Discussion objects. Only returned if the include query string parameter contains discussions.
	Expanded          bool         `json:"expanded,omitempty"`          // Indicates whether the row is expanded or collapsed
	FilteredOut       bool         `json:"filteredOut,omitempty"`       // true if this row is filtered out by a column filter (and thus is not displayed in the Smartsheet app), false if the row is not filtered out. Only returned if the include query string parameter contains filters.
	Format            string       `json:"format,omitempty"`            // Format descriptor (see Formatting). Only returned if the include query string parameter contains format and this row has a non-default format applied.
	InCriticalPath    bool         `json:"inCriticalPath,omitempty"`    // Only returned, with a value of true, if the sheet is a project sheet with dependencies enabled and this row is in the critical path
	Locked            bool         `json:"locked,omitempty"`            // Indicates whether the row is locked. In a response, a value of true indicates that the row has been locked by the sheet owner or the admin.
	LockedForUser     bool         `json:"lockedForUser,omitempty"`     // Indicates whether the row is locked for the requesting user. This attribute may be present in a response, but cannot be specified in a request.
	ModifiedAt        *time.Time   `json:"modifiedAt,omitempty"`        // Time of last modification
	ModifiedBy        *User        `json:"modifiedBy,omitempty"`        // User object containing name and email of the last person to modify this row
	Permalink         string       `json:"permalink,omitempty"`         // URL that represents a direct link to the row in Smartsheet. Only returned if the include query string parameter contains rowPermalink.
	Rownumber         int64        `json:"rownumber,omitempty"`         // Row int within the sheet (1-based - starts at 1)
	Version           int64        `json:"version,omitempty"`           // Sheet version int that is incremented every time a sheet is modified
	ToTop             bool         `json:"toTop,omitempty"`
	ToBottom          bool         `json:"toBottom,omitempty"`
}

func (Row) CellCount

func (r Row) CellCount() int

Return number of cells in the row

type Scope

type Scope struct {
	Sheets     []Sheet     `json:"sheets"`     // Array of Sheet objects (containing just the sheet ID) of any sheets that the requestor has access to that make up the report
	Workspaces []Workspace `json:"workspaces"` // Array of Workspace objects (containing just the workspace ID) that the requestor has access to that make up the report
}

type Sheet

type Sheet struct {
	Id                         int64                 `json:"id"`                         //Sheet Id
	FromId                     int64                 `json:"fromId"`                     // The Id of the template from which to create the sheet. This attribute can be specified in a request, but is never present in a response.
	OwnerId                    int64                 `json:"ownerId"`                    // User Id of the sheet owner
	AccessLevel                string                `json:"accessLevel"`                //User's permissions on the sheet
	Attachments                []Attachment          `json:"attachments"`                //Array of Attachment objects. Only returned if the include query string parameter contains Attachments.
	Columns                    []Column              `json:"columns"`                    // Array of Column objects
	CreatedAt                  string                `json:"createdAt"`                  // Time that the sheet was created
	CrossSheetReferences       []CrossSheetReference `json:"crossSheetReferences"`       // Array of CrossSheetReference objects. Only returned if the include query string parameter contains crossSheetReferences.
	DependenciesEnabled        bool                  `json:"dependenciesEnabled"`        //	Indicates whether dependencies are enabled
	Discussions                []Discussion          `json:"discussions"`                // Array of Discussion objects. Only returned if the include query string parameter contains discussions.
	EffectiveAttachmentOptions []string              `json:"effectiveAttachmentOptions"` // Array of enum strings (see Attachment.attachmentType) indicating the allowable attachment options for the current user and sheet
	Favorite                   bool                  `json:"favorite"`                   // Returned only if the user has marked this sheet as a favorite in their Home tab (value = true)
	GanttEnabled               bool                  `json:"ganttEnabled"`               //	Indicates whether "Gantt View" is enabled
	HasSummaryFields           bool                  `json:"hasSummaryFields"`           //	Indicates whether a sheet summary is present
	ModifiedAt                 string                `json:"modifiedAt"`                 // Time that the sheet was modified
	Name                       string                `json:"name"`                       // Sheet name
	Owner                      string                `json:"owner"`                      // Email address of the sheet owner
	Permalink                  string                `json:"permalink"`                  // URL that represents a direct link to the sheet in Smartsheet
	ProjectSettings            ProjectSettings       `json:"projectSettings"`            // Sheet's project settings containing the working days, non-working days, and length of day for a project sheet
	ReadOnly                   bool                  `json:"readOnly"`                   //	Returned only if the sheet beint64s // to an expired trial (value = true)
	ResourceManagementEnabled  bool                  `json:"resourceManagementEnabled"`  //	Indicates that resource management is enabled
	Rows                       []Row                 `json:"rows"`                       // Array of Row objects
	ShowParentRowsForFilters   bool                  `json:"showParentRowsForFilters"`   //	Returned only if there are column filters on the sheet. Value = true if "show parent rows" is enabled for the filters.
	Source                     Source                `json:"source"`                     // A Source object indicating the report, sheet, Sight (aka dashboard), or template from which this sheet was created, if any
	Summary                    SheetSummary          `json:"summary"`                    // A SheetSummary object containing a list of defined fields and values for the sheet.
	TotalRowCount              int                   `json:"totalRowCount"`              // The total int // of rows in the sheet
	UserPermissions            SheetUserPermissions  `json:"userPermissions"`            // A SheetUserPermissions object indicating what summary operations are possible for the current user
	UserSettings               SheetUserSettings     `json:"userSettings"`               // A SheetUserSettings object containing the current user's sheet-specific settings.
	Version                    int                   `json:"version"`                    // A int // that is incremented every time a sheet is modified
	Workspace                  Workspace             `json:"workspace"`                  // A Workspace object containing the workspace Id and name.
}

func (Sheet) GetColumnById

func (s Sheet) GetColumnById(id int64) (*Column, error)

Return Column object with id

func (Sheet) GetColumnByName

func (s Sheet) GetColumnByName(name string) (*Column, error)

Return Column object with title name

type SheetSummary

type SheetSummary struct {
	Fields []SummaryField // Array of summary (or metadata) fields defined on the sheet.
}

type SheetUserPermissions

type SheetUserPermissions struct {
	SummaryPermissions string
}

type SheetUserSettings

type SheetUserSettings struct {
	CriticalPathEnabled bool // Does this user have "Show Critical Path" turned on for this sheet? NOTE: This setting only has an effect on project sheets with dependencies enabled.
	DisplaySummaryTasks bool // Does this user have "Display Summary Tasks" turned on for this sheet? Applies only to sheets where "Calendar View" has been configured.
}

type Sight

type Sight struct {
	Id              int       `json:"id"`              // Sight Id
	AccessLevel     string    `json:"accessLevel"`     // User's permissions on the Sight
	BackgroundColor string    `json:"backgroundColor"` // The hex color, for instance #E6F5FE
	ColumnCount     int       `json:"columnCount"`     //	Number of columns that the Sight contains
	CreatedAt       time.Time `json:"createdAt"`       //	Time of creation
	Favorite        bool      `json:"favorite"`        //	Indicates whether the user has marked the Sight as a favorite
	ModifiedAt      time.Time `json:"modifiedAt"`      //	Time of last modification
	Name            string    `json:"name"`            //	Sight name
	Permalink       string    `json:"permalink"`       //	URL that represents a direct link to the Sight in Smartsheet
	Source          Source    `json:"source"`          //	A Source object indicating the Sight (aka dashboard) from which this Sight was created, if any
	Widgets         []Widget  `json:"widgets"`         //	Array of Widget objects
	Workspace       Workspace `json:"workspace"`       //	A Workspace object, limited to only 2 attributes:
}

type Source

type Source struct {
	Id   int64  `json:"id"`   // Id of the report, sheet, Sight (aka dashboard), or template from which the enclosing report, sheet, Sight, or template was created
	Type string `json:"type"` // report, sheet, sight, or template
}

type SummaryField

type SummaryField struct {
	Id             int64           `json:"id"`             // SummaryField Id
	ContactOptions []ContactOption `json:"contactOptions"` // Array of ContactOption objects to specify a pre-defined list of values for the column. Column type must be CONTACT_LIST
	CreatedAt      time.Time       `json:"createdAt"`      // Time of Bcreation
	CreatedBy      User            `json:"createdBy"`      // User object containing name and email of the summaryField's author
	DisplayValue   string          `json:"displayValue"`   // Visual representation of cell contents, as presented to the user in the UI. See Cell Reference.
	Format         string          `json:"format"`         // The format descriptor (see Formatting). Only returned if the include query string parameter contains format and this column has a non-default format applied to it.
	Formula        string          `json:"formula"`        // The formula for a cell, if set. NOTE: calculation errors or problems with a formula do not cause the API call to return an error code. Instead, the response contains the same value as in the UI, such as field.value = "#CIRCULAR REFERENCE".
	Hyperlink      Hyperlink       `json:"hyperlink"`      // A hyperlink to a URL, sheet, or report
	Image          Image           `json:"image"`          // The image that the field contains. Only returned if the field contains an image.
	Index          int64           `json:"index"`          // Field index or position. This int is zero-based.
	Locked         bool            `json:"locked"`         // Indicates whether the field is locked. In a response, a value of true indicates that the field has been locked by the sheet owner or the admin.
	LockedForUser  bool            `json:"lockedForUser"`  // Indicates whether the field is locked for the requesting user. This attribute may be present in a response, but cannot be specified in a request.
	ModifiedAt     time.Time       `json:"modifiedAt"`     // Time of last modification
	ModifiedBy     User            `json:"modifiedBy"`     // User object containing name and email of the summaryField's author
	ObjectValue    ObjectValue     `json:"objectValue"`    // Required for date and contact fields
	Options        []string        `json:"options"`        // When applicable for PICKLIST column type. Array of the options available for the field
	Symbol         string          `json:"symbol"`         // When applicable for PICKLIST column type. See Symbol Columns.
	Title          string          `json:"title"`          // Arbitrary name, must be unique within summary
	Type           string          `json:"type"`           // One of:
	Validation     bool            `json:"validation"`     // Indicates whether summary field values are restricted to the type
}

type Template

type Template struct {
	Id             int      // Template Id
	Type           string   // Type of the template. One of sheet or report. Only applicable to public templates
	AccessLevel    string   // User's permissions on the template
	Blank          bool     // Indicates whether the template is blank. Only applicable to public templates
	Categories     []string // List of categories this template belongs to. Only applicable to public templates
	Description    string   // Template description
	GlobalTemplate string   // Type of global template. One of: BLANK_SHEET, PROJECT_SHEET, or TASK_LIST. Only applicable to blank public templates
	Image          string   // URL to the small preview image for this template. Only applicable to non-blank public templates
	LargeImage     string   // URL to the large preview image for this template. Only applicable to non-blank public templates
	Locale         string   // Locale of the template. Only applicable to public templates
	Name           string   // Template name
	Tags           []string // List of search tags for this template. Only applicable to non-blank public templates
}

type User

type User struct {
	Id                        int        `json:"id,omitempty"`                        //   User Id
	Admin                     bool       `json:"admin,omitempty"`                     //   Indicates whether the user is a system admin (can manage user accounts and organization account)
	CustomWelcomeScreenViewed *time.Time `json:"customWelcomeScreenViewed,omitempty"` //    Timestamp of viewing an Enterprise Custom Welcome Screen by the current user
	Email                     string     `json:"email,omitempty"`                     //User's primary email address
	FirstName                 string     `json:"firstName,omitempty"`                 //User's first name
	GroupAdmin                bool       `json:"groupAdmin,omitempty"`                //Indicates whether the user is a group admin (can create and edit groups)
	LastLogin                 *time.Time `json:"lastLogin,omitempty"`                 //Last login time of the current user
	LastName                  string     `json:"lastName,omitempty"`                  //User's last name
	LicensedSheetCreator      bool       `json:"licensedSheetCreator,omitempty"`      // Indicates whether the user is a licensed user (can create and own sheets)
	Name                      string     `json:"name,omitempty"`                      //User's full name (read-only)
	ProfileImage              *Image     `json:"profile,omitempty"`                   //An Image object representing the profile image associated with the user account
	ResourceViewer            bool       `json:"resourceViewer,omitempty"`            //Indicates whether the user is a resource viewer (can access resource views)
	SheetCount                int        `json:"sheetCount,omitempty"`                //The number of sheets owned by the current user within the organization account
	Status                    string     `json:"status,omitempty"`                    //User status, set to one of the following values: ACTIVE, DECLINED, or PENDING
}

type Webhook

type Webhook struct {
	Id              int64        `json:"id,omitempty"`              // Webhook Id
	ApiClientId     string       `json:"apiClientId,omitempty"`     // API client Id corresponding to third-party app that created the webhook. Read-only. Only present if webhook was created by third-party app.
	ScopeObjectId   int64        `json:"scopeObjectId,omitempty"`   // Id of the object that is subscribed to. Specified when a webhook is created and cannot be changed.
	ApiClientName   string       `json:"apiClientName,omitempty"`   // API client name corresponding to third-party app that created the webhook. Read-only. Only present if webhook was created by third-party app.
	CallbackUrl     string       `json:"callbackUrl,omitempty"`     // HTTPS URL where callbacks are sent.
	CreatedAt       *time.Time   `json:"createdAt,omitempty"`       // Time of creation. Read-only.
	DisabledDetails string       `json:"disabledDetails,omitempty"` // Details about the reason the webhook was disabled. Read-only. Only present when enabled=false.
	Enabled         bool         `json:"enabled,omitempty"`         // Indicates whether the webhook is on (true) or off (false)
	Events          []string     `json:"events,omitempty"`          // Array of the events that are subscribed to. Currently, must be an array of size 1 that contains the string value "*.*", which means "all objects" and "all events".
	ModifiedAt      *time.Time   `json:"modifiedAt,omitempty"`      // Time of last modification. Read-only.
	Name            string       `json:"name,omitempty"`            // Webhook name
	Scope           string       `json:"scope,omitempty"`           // Scope of the subscription. Currently, the only supported value is sheet. Specified when a webhook is created and cannot be changed.
	SharedSecret    string       `json:"sharedSecret,omitempty"`    // Shared secret for this webhook, randomly generated by Smartsheet. Read-only. See Authenticating Callbacks for details about how this value can be used.
	Stats           WebhookStats `json:"stats,omitempty"`           // Useful statistics for this webhook. Only returned once this webhook has performed a callback attempt. Read-only.
	Status          string       `json:"status,omitempty"`          // Webhook status. Read-only. See Webhook Status for list of possible values.
	Subscope        []int64      `json:"subscope,omitempty"`        // Array of columnIds if you want to limit the subscription to a subscope. Specified when a webhook is created and cannot be changed.
	Version         int64        `json:"version,omitempty"`         // Webhook version. Currently, the only supported value is 1. This attribute is intended to ensure backward compatibility as new webhook functionality is released. For example, a webhook with a version of 1 is guaranteed to always be sent callback objects that are compatible with the version 1 release of webhooks.
}

type WebhookStats

type WebhookStats struct {
	LastCallbackAttempt           *time.Time `json:"lastCallbackAttempt,omitempty"`           // When this webhook last made a callback attempt.
	LastCallbackAttemptRetryCount int        `json:"lastCallbackAttemptRetryCount,omitempty"` // The number of retries the webhook had performed as of the last callback attempt.
	LastSuccessfulCallback        *time.Time `json:"lastSuccessfulCallback,omitempty"`        // When this webhook last made a successful callback.
}

type Widget

type Widget struct {
	Id            int         `json:"id"`            // 	Widget Id
	Type          string      `json:"type"`          // Type of widget. See table below to see how UI widget names map to type.
	Contents      interface{} `json:"contents"`      // object 	Data that specifies the contents of the widget. NOTE: The type of WidgetContent object (and attributes within) depends on the value of widget.type.
	Height        int         `json:"height"`        // 	Number of rows that the widget occupies on the Sight
	ShowTitle     bool        `json:"showTitle"`     //	True indicates that the client should display the widget title. NOTE: This is independent of the title string which may be null or empty.
	ShowTitleIcon bool        `json:"showTitleIcon"` //	True indicates that the client should display the sheet icon in the widget title
	Title         string      `json:"title"`         // Title of the widget
	TitleFormat   string      `json:"titleFormat"`   // FormatDescriptor
	Version       int         `json:"version"`       // Widget version int //
	ViewMode      int         `json:"viewMode"`      //	1 indicates content is centered. 2 indicates content is left aligned. Must use a query parameter of level=2 to see this information.
	Width         int         `json:"width"`         // 	Number of columns that the widget occupies on the Sight
	XPosition     int         `json:"xPosition"`     // 	X-coordinate of widget's position on the Sight
	YPosition     int         `json:"yPosition"`     // 	Y-coordinate of widget's position on the Sight
}

type Workspace

type Workspace struct {
	Id          int        `json:"id"`          // Workspace Id
	AccessLevel string     `json:"accessLevel"` // User's permissions on the workspace
	Favorite    bool       `json:"favorite"`    // Returned only if the user has marked the workspace as a favorite in their "Home" tab (value = true)
	Folders     []Folder   `json:"folders"`     // Array of Folder objects
	Name        string     `json:"name"`        // Workspace name
	Permalink   string     `json:"permalink"`   // URL that represents a direct link to the workspace in Smartsheet
	Reports     []Report   `json:"reports"`     // Array of Report objects
	Sheets      []Sheet    `json:"sheets"`      // Array of Sheet objects
	Sights      []Sight    `json:"sights"`      // Array of Sight objects
	Templates   []Template `json:"templates"`   // Array of Template objects
}

Jump to

Keyboard shortcuts

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