Documentation
¶
Index ¶
- type FlexibleAsset
- type FlexibleAssetData
- type FlexibleAssetField
- type FlexibleAssetFieldData
- type FlexibleAssetFieldList
- type FlexibleAssetList
- type FlexibleAssetType
- type FlexibleAssetTypeData
- type FlexibleAssetTypeList
- type ITGAPI
- func (itg *ITGAPI) BuildURL(restAction string) (*url.URL, error)
- func (itg *ITGAPI) DeleteFlexibleAsset(flexibleAssetID int) ([]byte, error)
- func (itg *ITGAPI) DeletePassword(passwordID int) ([]byte, error)
- func (itg *ITGAPI) GetFlexibleAssetFields(flexibleAssetTypeID int, pageNumber int) (*FlexibleAssetFieldList, error)
- func (itg *ITGAPI) GetFlexibleAssetTypes(pageNumber int) (*FlexibleAssetTypeList, error)
- func (itg *ITGAPI) GetFlexibleAssets(flexibleAssetTypeID int, pageNumber int) (*FlexibleAssetList, error)
- func (itg *ITGAPI) GetFlexibleAssetsByID(flexibleAssetID int) (*FlexibleAsset, error)
- func (itg *ITGAPI) GetFlexibleAssetsByName(flexibleAssetTypeID int, flexibleAssetName string, pageNumber int) (*FlexibleAssetList, error)
- func (itg *ITGAPI) GetFlexibleAssetsByOrganizationID(flexibleAssetTypeID int, OrganizationID int, pageNumber int) (*FlexibleAssetList, error)
- func (itg *ITGAPI) GetFlexibleAssetsByOrganizationIDAndName(flexibleAssetTypeID int, OrganizationID int, flexibleAssetName string, ...) (*FlexibleAssetList, error)
- func (itg *ITGAPI) GetOrganizationByID(organizationID int) (*Organization, error)
- func (itg *ITGAPI) GetOrganizationByName(organizationName string, pageNumber int) (*OrganizationList, error)
- func (itg *ITGAPI) GetOrganizationStatuses(pageNumber int) (*OrganizationStatusList, error)
- func (itg *ITGAPI) GetOrganizationTypes(pageNumber int) (*OrganizationTypeList, error)
- func (itg *ITGAPI) GetPasswords(pageNumber int) (*PasswordList, error)
- func (itg *ITGAPI) GetPasswordsByID(passwordID int) (*Password, error)
- func (itg *ITGAPI) GetUserMetrics(pageNumber int) (*UserMetricList, error)
- func (itg *ITGAPI) GetUsers(pageNumber int) (*UserList, error)
- func (itg *ITGAPI) NewRequest(restAction, method string, body []byte) *Request
- func (itg *ITGAPI) PatchFlexibleAsset(flexibleAssetID int, asset *FlexibleAsset) (*FlexibleAsset, error)
- func (itg *ITGAPI) PatchPassword(passwordID int, asset *Password) (*Password, error)
- func (itg *ITGAPI) PostFlexibleAsset(asset *FlexibleAsset) (*FlexibleAsset, error)
- func (itg *ITGAPI) PostPassword(asset *Password) (*Password, error)
- type Links
- type Metadata
- type Organization
- type OrganizationData
- type OrganizationList
- type OrganizationStatus
- type OrganizationStatusData
- type OrganizationStatusList
- type OrganizationType
- type OrganizationTypeData
- type OrganizationTypeList
- type Password
- type PasswordData
- type PasswordList
- type Request
- type User
- type UserData
- type UserList
- type UserMetric
- type UserMetricData
- type UserMetricList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlexibleAsset ¶
type FlexibleAsset struct { Data struct{ FlexibleAssetData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type FlexibleAssetData ¶
type FlexibleAssetData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { OrganizationID int `json:"organization-id"` OrganizationName string `json:"organization-name"` ResourceURL string `json:"resource-url"` Restricted bool `json:"restricted"` MyGlue bool `json:"my-glue"` FlexibleAssetTypeID int `json:"flexible-asset-type-id"` FlexibleAssetTypeName string `json:"flexible-asset-type-name"` Name string `json:"name"` Traits map[string]interface { } `json:"traits"` Archived bool `json:"archived"` CreatedAt time.Time `json:"created-at"` UpdatedAt time.Time `json:"updated-at"` } `json:"attributes"` Relationships struct { } `json:"relationships"` }
type FlexibleAssetField ¶
type FlexibleAssetField struct { Data struct{ FlexibleAssetFieldData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type FlexibleAssetFieldData ¶
type FlexibleAssetFieldData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { Order int `json:"order"` Name string `json:"name"` Kind string `json:"kind"` Hint interface{} `json:"hint"` Decimals int `json:"decimals"` TagType interface{} `json:"tag-type"` Required bool `json:"required"` UseForTitle bool `json:"use-for-title"` Expiration bool `json:"expiration"` ShowInList bool `json:"show-in-list"` NameKey string `json:"name-key"` CreatedAt time.Time `json:"created-at"` UpdatedAt time.Time `json:"updated-at"` FlexibleAssetTypeID int `json:"flexible-asset-type-id"` DefaultValue interface{} `json:"default-value"` } `json:"attributes"` Relationships struct { FlexibleAssetType struct { FlexibleAssetType } `json:"flexible-asset-type"` } `json:"relationships"` }
type FlexibleAssetFieldList ¶
type FlexibleAssetFieldList struct { Data []struct{ FlexibleAssetFieldData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type FlexibleAssetList ¶
type FlexibleAssetList struct { Data []struct{ FlexibleAssetData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type FlexibleAssetType ¶
type FlexibleAssetType struct { Data struct{ FlexibleAssetTypeData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type FlexibleAssetTypeData ¶
type FlexibleAssetTypeData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { Name string `json:"name"` Description string `json:"description"` CreatedAt time.Time `json:"created-at"` UpdatedAt time.Time `json:"updated-at"` Icon string `json:"icon"` Enabled bool `json:"enabled"` } `json:"attributes"` Relationships struct { } `json:"relationships"` }
type FlexibleAssetTypeList ¶
type FlexibleAssetTypeList struct { Data []struct{ FlexibleAssetTypeData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type ITGAPI ¶
ITGAPI contains the ITG API URL for North America, as well as the API key. Think of it as an instance of the API client
func NewITGAPI ¶
NewITGAPI expects the API key to be passed to it Returns a pointer to an ITGAPI struct
func (*ITGAPI) BuildURL ¶
BuildURL expects a restaction to be passed to it Returns the full request URL containing the ITG API domain prepended to the rest action
func (*ITGAPI) DeleteFlexibleAsset ¶
DeleteFlexibleAsset delete asset
func (*ITGAPI) DeletePassword ¶
DeletePassword delete asset
func (*ITGAPI) GetFlexibleAssetFields ¶
func (itg *ITGAPI) GetFlexibleAssetFields(flexibleAssetTypeID int, pageNumber int) (*FlexibleAssetFieldList, error)
func (*ITGAPI) GetFlexibleAssetTypes ¶
func (itg *ITGAPI) GetFlexibleAssetTypes(pageNumber int) (*FlexibleAssetTypeList, error)
func (*ITGAPI) GetFlexibleAssets ¶
func (itg *ITGAPI) GetFlexibleAssets(flexibleAssetTypeID int, pageNumber int) (*FlexibleAssetList, error)
GetFlexibleAssets returns flexible assets
func (*ITGAPI) GetFlexibleAssetsByID ¶
func (itg *ITGAPI) GetFlexibleAssetsByID(flexibleAssetID int) (*FlexibleAsset, error)
GetFlexibleAssetsByID returns flexible assets
func (*ITGAPI) GetFlexibleAssetsByName ¶
func (itg *ITGAPI) GetFlexibleAssetsByName(flexibleAssetTypeID int, flexibleAssetName string, pageNumber int) (*FlexibleAssetList, error)
GetFlexibleAssetsByName returns flexible assets
func (*ITGAPI) GetFlexibleAssetsByOrganizationID ¶
func (itg *ITGAPI) GetFlexibleAssetsByOrganizationID(flexibleAssetTypeID int, OrganizationID int, pageNumber int) (*FlexibleAssetList, error)
GetFlexibleAssetsByOrganizationID returns flexible assets
func (*ITGAPI) GetFlexibleAssetsByOrganizationIDAndName ¶
func (itg *ITGAPI) GetFlexibleAssetsByOrganizationIDAndName(flexibleAssetTypeID int, OrganizationID int, flexibleAssetName string, pageNumber int) (*FlexibleAssetList, error)
GetFlexibleAssetsByOrganizationIDAndName returns flexible assets
func (*ITGAPI) GetOrganizationByID ¶
func (itg *ITGAPI) GetOrganizationByID(organizationID int) (*Organization, error)
GetOrganizationByID expects an ITG organization ID Returns a pointer to an Organization struct
func (*ITGAPI) GetOrganizationByName ¶
func (itg *ITGAPI) GetOrganizationByName(organizationName string, pageNumber int) (*OrganizationList, error)
GetOrganizationByName expects an exact matching organization name and returns an OrganizationList
func (*ITGAPI) GetOrganizationStatuses ¶
func (itg *ITGAPI) GetOrganizationStatuses(pageNumber int) (*OrganizationStatusList, error)
func (*ITGAPI) GetOrganizationTypes ¶
func (itg *ITGAPI) GetOrganizationTypes(pageNumber int) (*OrganizationTypeList, error)
/organization_types
func (*ITGAPI) GetPasswords ¶
func (itg *ITGAPI) GetPasswords(pageNumber int) (*PasswordList, error)
GetPasswords returns passwords
func (*ITGAPI) GetPasswordsByID ¶
GetPasswordsByID returns passwords
func (*ITGAPI) GetUserMetrics ¶
func (itg *ITGAPI) GetUserMetrics(pageNumber int) (*UserMetricList, error)
func (*ITGAPI) NewRequest ¶
NewRequest is a function which takes the mandatory fields to perform a request to the CW API and returns a pointer to a Request struct
func (*ITGAPI) PatchFlexibleAsset ¶
func (itg *ITGAPI) PatchFlexibleAsset(flexibleAssetID int, asset *FlexibleAsset) (*FlexibleAsset, error)
PatchFlexibleAsset update asset. Any trait not specified will be deleted
func (*ITGAPI) PatchPassword ¶
PatchPassword update asset. Any attributes you don't specify will remain unchanged.
func (*ITGAPI) PostFlexibleAsset ¶
func (itg *ITGAPI) PostFlexibleAsset(asset *FlexibleAsset) (*FlexibleAsset, error)
PostFlexibleAsset create new asset
type Organization ¶
type Organization struct { Data struct{ OrganizationData } `json:"data"` Meta struct{ Metadata } `json:"meta"` }
Organization contains a single Organization
type OrganizationData ¶
type OrganizationData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { Name string `json:"name"` Description string `json:"description"` OrganizationTypeID int `json:"organization-type-id"` OrganizationTypeName string `json:"organization-type-name"` OrganizationStatusID int `json:"organization-status-id"` OrganizationStatusName string `json:"organization-status-name"` Logo string `json:"logo"` QuickNotes string `json:"quick-notes"` ShortName string `json:"short-name"` CreatedAt string `json:"created-at"` UpdatedAt string `json:"updated-at"` } `json:"attributes"` }
OrganizationData contains the schema of an Organization in IT Glue without the "data" wrapper. This allows us to reuse the schema when data is either a JSON object or an array, depending on what results are returned
type OrganizationList ¶
type OrganizationList struct { Data []struct{ OrganizationData } `json:"data"` Meta struct{ Metadata } `json:"meta"` }
OrganizationList contains a slice of Organizations
type OrganizationStatus ¶
type OrganizationStatus struct { Data struct{ OrganizationStatusData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type OrganizationStatusData ¶
type OrganizationStatusList ¶
type OrganizationStatusList struct { Data []struct{ OrganizationStatusData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type OrganizationType ¶
type OrganizationType struct { Data struct{ OrganizationTypeData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type OrganizationTypeData ¶
type OrganizationTypeList ¶
type OrganizationTypeList struct { Data []struct{ OrganizationTypeData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type Password ¶
type Password struct { Data struct{ PasswordData } `json:"data,omitempty"` Meta struct{ Metadata } `json:"meta,omitempty"` Links struct{ Links } `json:"links,omitempty"` }
type PasswordData ¶
type PasswordData struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Attributes struct { OrganizationID int `json:"organization-id,omitempty"` OrganizationName string `json:"organization-name,omitempty"` ResourceURL string `json:"resource-url,omitempty"` Restricted bool `json:"restricted,omitempty"` MyGlue bool `json:"my-glue,omitempty"` Name string `json:"name,omitempty"` AutofillSelectors interface{} `json:"autofill-selectors,omitempty"` Username string `json:"username,omitempty"` URL string `json:"url,omitempty"` Notes string `json:"notes,omitempty"` PasswordUpdatedAt *time.Time `json:"password-updated-at,omitempty"` UpdatedBy int `json:"updated-by,omitempty"` UpdatedByType string `json:"updated-by-type,omitempty"` ResourceID int `json:"resource-id,omitempty"` CachedResourceTypeName string `json:"cached-resource-type-name,omitempty"` CachedResourceName string `json:"cached-resource-name,omitempty"` PasswordCategoryID int `json:"password-category-id,omitempty"` PasswordCategoryName string `json:"password-category-name,omitempty"` CreatedAt *time.Time `json:"created-at,omitempty"` UpdatedAt *time.Time `json:"updated-at,omitempty"` OtpEnabled bool `json:"otp-enabled,omitempty"` PasswordFolderID int `json:"password-folder-id,omitempty"` ResourceType string `json:"resource-type,omitempty"` ParentURL string `json:"parent-url,omitempty"` VaultID int `json:"vault-id,omitempty"` Archived bool `json:"archived,omitempty"` Password string `json:"password,omitempty"` } `json:"attributes,omitempty"` Relationships struct { } `json:"relationships,omitempty"` }
PasswordData struct, pointers to have omitempty work for time.Time
type PasswordList ¶
type PasswordList struct { Data []struct{ PasswordData } `json:"data,omitempty"` Meta struct{ Metadata } `json:"meta,omitempty"` Links struct{ Links } `json:"links,omitempty"` }
type Request ¶
type Request struct { ITG *ITGAPI RestAction string Method string //GET, POST, DELETE, etc Body []byte //In a GET request, this is an instance of the struct that the expected json data is to be unmarshaled into URLValues url.Values //Parameters sent to ITG for filtering by conditions that utilize strings RawURLValues string //URL values must be a string. Raw URL values allow an int to be used, for instance in a filter Page int PageSize int }
type UserData ¶
type UserData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { FirstName string `json:"first-name"` LastName string `json:"last-name"` Name string `json:"name"` RoleName string `json:"role-name"` Email string `json:"email"` InvitationSentAt time.Time `json:"invitation-sent-at"` InvitationAcceptedAt time.Time `json:"invitation-accepted-at"` CurrentSignInAt time.Time `json:"current-sign-in-at"` CurrentSignInIP string `json:"current-sign-in-ip"` LastSignInAt time.Time `json:"last-sign-in-at"` LastSignInIP string `json:"last-sign-in-ip"` Reputation int `json:"reputation"` CreatedAt time.Time `json:"created-at"` UpdatedAt time.Time `json:"updated-at"` MyGlueAccountID interface{} `json:"my-glue-account-id"` Avatar string `json:"avatar"` MyGlue bool `json:"my-glue"` } `json:"attributes"` }
type UserMetric ¶
type UserMetric struct { Data struct{ UserMetricData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }
type UserMetricData ¶
type UserMetricData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { UserID int `json:"user-id"` OrganizationID int `json:"organization-id"` Created int `json:"created"` Viewed int `json:"viewed"` Edited int `json:"edited"` Deleted int `json:"deleted"` Date string `json:"date"` ResourceType string `json:"resource-type"` } `json:"attributes"` }
type UserMetricList ¶
type UserMetricList struct { Data []struct{ UserMetricData } `json:"data"` Meta struct{ Metadata } `json:"meta"` Links struct{ Links } `json:"links"` }