Documentation
¶
Overview ¶
Package models provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.0 DO NOT EDIT.
Index ¶
- Constants
- type AuthorizationAddedEventData
- type AuthorizationRevokedEventData
- type ConfirmMessagesJSONRequestBody
- type ConfirmMessagesParams
- type ConfirmMessagesRequest
- type DeleteEndpointParams
- type Endpoint
- type EndpointCapability
- type EndpointCapabilityDirection
- type EndpointDeletedEventData
- type EndpointRouteMap
- type EndpointSubscription
- type EndpointType
- type EndpointsListChangedEventData
- type EndpointsListResponse
- type ErrorResponse
- type ExternalId
- type FileReceivedEventData
- type GenericEventData
- func (t GenericEventData) AsAuthorizationAddedEventData() (AuthorizationAddedEventData, error)
- func (t GenericEventData) AsAuthorizationRevokedEventData() (AuthorizationRevokedEventData, error)
- func (t GenericEventData) AsEndpointDeletedEventData() (EndpointDeletedEventData, error)
- func (t GenericEventData) AsEndpointsListChangedEventData() (EndpointsListChangedEventData, error)
- func (t GenericEventData) AsFileReceivedEventData() (FileReceivedEventData, error)
- func (t GenericEventData) AsMessageReceivedEventData() (MessageReceivedEventData, error)
- func (t GenericEventData) Discriminator() (string, error)
- func (t *GenericEventData) FromAuthorizationAddedEventData(v AuthorizationAddedEventData) error
- func (t *GenericEventData) FromAuthorizationRevokedEventData(v AuthorizationRevokedEventData) error
- func (t *GenericEventData) FromEndpointDeletedEventData(v EndpointDeletedEventData) error
- func (t *GenericEventData) FromEndpointsListChangedEventData(v EndpointsListChangedEventData) error
- func (t *GenericEventData) FromFileReceivedEventData(v FileReceivedEventData) error
- func (t *GenericEventData) FromMessageReceivedEventData(v MessageReceivedEventData) error
- func (t GenericEventData) MarshalJSON() ([]byte, error)
- func (t *GenericEventData) MergeAuthorizationAddedEventData(v AuthorizationAddedEventData) error
- func (t *GenericEventData) MergeAuthorizationRevokedEventData(v AuthorizationRevokedEventData) error
- func (t *GenericEventData) MergeEndpointDeletedEventData(v EndpointDeletedEventData) error
- func (t *GenericEventData) MergeEndpointsListChangedEventData(v EndpointsListChangedEventData) error
- func (t *GenericEventData) MergeFileReceivedEventData(v FileReceivedEventData) error
- func (t *GenericEventData) MergeMessageReceivedEventData(v MessageReceivedEventData) error
- func (t *GenericEventData) UnmarshalJSON(b []byte) error
- func (t GenericEventData) ValueByDiscriminator() (interface{}, error)
- type MessageConfirmation
- type MessageReceivedEventData
- type PayloadURI
- type PutEndpointJSONRequestBody
- type PutEndpointParams
- type PutEndpointRequest
- type ReceiveEventsParams
- type ReceiveEventsParamsTypes
- type RoutedEndpoints
- type SendMessagesParams
- type TenantEndpointCapabilities
- type TenantEndpointInfo
- type TenantId
- type TenantInfo
- type TenantsListResponse
- type XAgrirouterTenantId
Constants ¶
const ( AgrirouterOauthPRODScopes = "agrirouterOauthPROD.Scopes" AgrirouterOauthQAScopes = "agrirouterOauthQA.Scopes" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationAddedEventData ¶ added in v0.8.0
type AuthorizationAddedEventData struct {
EventType string `json:"event_type"`
// Scope The OAuth scope that was granted with this authorization. Today
// the only scope in use is `endpoints:manage`; additional scopes may
// be introduced in future revisions of this API.
Scope string `json:"scope"`
Tenant TenantInfo `json:"tenant"`
}
AuthorizationAddedEventData Data structure for AUTHORIZATION_ADDED events. This event would arrive whenever a user adds an authorization for a tenant to the current application.
An authorization is uniquely identified by the triple (tenant_id, application_id, scope). The application_id is implicit from the receiving subscription; tenant_id and scope are explicit on this event. At present the only scope in use is `endpoints:manage`; additional scopes may be added in the future, and clients should then treat authorizations with different scopes as distinct authorizations even when tenant_id matches.
type AuthorizationRevokedEventData ¶ added in v0.8.0
type AuthorizationRevokedEventData struct {
EventType string `json:"event_type"`
// Scope The OAuth scope of the authorization that was revoked. Today the
// only scope in use is `endpoints:manage`; additional scopes may be
// introduced in future revisions of this API.
Scope string `json:"scope"`
// TenantId The tenant whose authorization was revoked.
TenantId openapi_types.UUID `json:"tenant_id"`
}
AuthorizationRevokedEventData Data structure for AUTHORIZATION_REVOKED events. This event would arrive whenever a user revokes an authorization for a tenant from the current application. When this event is delivered to you, you have already lost access to the target tenant for the given scope. You should clean up all information related to this tenant (for that scope) and update your state accordingly.
All endpoints that were previously accessible via this authorization are considered removed. You will receive distinct ENDPOINT_DELETED events for all endpoints deleted as a result of the authorization revocation.
Authorizations are uniquely identified by (tenant_id, application_id, scope); only the authorization matching the `scope` below was revoked. At present only the `endpoints:manage` scope is in use, but if additional scopes are introduced later, other scopes for the same tenant would remain in effect.
type ConfirmMessagesJSONRequestBody ¶ added in v0.4.0
type ConfirmMessagesJSONRequestBody = ConfirmMessagesRequest
ConfirmMessagesJSONRequestBody defines body for ConfirmMessages for application/json ContentType.
type ConfirmMessagesParams ¶ added in v0.4.0
type ConfirmMessagesParams struct {
// XAgrirouterTenantId The farmer's tenant ID in relation to which communication is done.
XAgrirouterTenantId XAgrirouterTenantId `json:"x-agrirouter-tenant-id"`
}
ConfirmMessagesParams defines parameters for ConfirmMessages.
type ConfirmMessagesRequest ¶ added in v0.4.0
type ConfirmMessagesRequest struct {
// Confirmations List of message confirmations.
Confirmations []MessageConfirmation `json:"confirmations"`
}
ConfirmMessagesRequest defines model for ConfirmMessagesRequest.
type DeleteEndpointParams ¶ added in v0.6.0
type DeleteEndpointParams struct {
// XAgrirouterTenantId The farmer's tenant ID in relation to which communication is done.
XAgrirouterTenantId XAgrirouterTenantId `json:"x-agrirouter-tenant-id"`
}
DeleteEndpointParams defines parameters for DeleteEndpoint.
type Endpoint ¶
type Endpoint struct {
// AllowDeleteByUser Flag indicating whether the user is allowed to delete this endpoint.
AllowDeleteByUser *bool `json:"allow_delete_by_user,omitempty"`
ApplicationId openapi_types.UUID `json:"application_id"`
Capabilities []EndpointCapability `json:"capabilities"`
// ConnectionsUri URI pointing to where the user can manage the entity connected to this endpoint, e.g. to disconnect or delete equipment from an equipment vendor.
ConnectionsUri *string `json:"connections_uri,omitempty"`
EndpointType EndpointType `json:"endpoint_type"`
ExternalId string `json:"external_id"`
Id openapi_types.UUID `json:"id"`
SoftwareVersionId openapi_types.UUID `json:"software_version_id"`
// TenantId The tenant ID of the endpoint
TenantId string `json:"tenant_id"`
}
Endpoint defines model for Endpoint.
type EndpointCapability ¶
type EndpointCapability struct {
Direction EndpointCapabilityDirection `json:"direction"`
// MessageType The message type that the endpoint can send or receive.
// See available types here:
// https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html
MessageType string `json:"message_type"`
}
EndpointCapability defines model for EndpointCapability.
type EndpointCapabilityDirection ¶
type EndpointCapabilityDirection string
EndpointCapabilityDirection defines model for EndpointCapability.Direction.
const ( RECEIVE EndpointCapabilityDirection = "RECEIVE" SEND EndpointCapabilityDirection = "SEND" SENDRECEIVE EndpointCapabilityDirection = "SEND_RECEIVE" )
Defines values for EndpointCapabilityDirection.
type EndpointDeletedEventData ¶ added in v0.6.0
type EndpointDeletedEventData struct {
EventType string `json:"event_type"`
// ExternalId The external ID of the deleted endpoint, which was provided when creating or updating the endpoint.
ExternalId string `json:"external_id"`
// Id The agrirouter endpoint ID of the deleted endpoint.
Id openapi_types.UUID `json:"id"`
}
EndpointDeletedEventData Data structure for ENDPOINT_DELETED events. This event would arrive whenever one of the endpoints of the application is deleted from agrirouter, either by this API or by other means.
type EndpointRouteMap ¶ added in v0.8.0
EndpointRouteMap Map keyed by agrirouter endpoint ID. Each value lists the message types for which routing is currently possible between the two endpoints.
type EndpointSubscription ¶
type EndpointSubscription struct {
// MessageType The message type that the endpoint is subscribed to.
// See available types here:
// https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html
MessageType string `json:"message_type"`
}
EndpointSubscription defines model for EndpointSubscription.
type EndpointType ¶
type EndpointType string
EndpointType defines model for EndpointType.
const ( CloudSoftware EndpointType = "cloud_software" FarmingSoftware EndpointType = "farming_software" VirtualCommunicationUnit EndpointType = "virtual_communication_unit" )
Defines values for EndpointType.
type EndpointsListChangedEventData ¶ added in v0.8.0
type EndpointsListChangedEventData struct {
// Endpoints Complete current list of endpoints in the tenant that are visible
// to the application.
Endpoints []TenantEndpointInfo `json:"endpoints"`
EventType string `json:"event_type"`
// TenantId The tenant whose endpoint list changed.
TenantId openapi_types.UUID `json:"tenant_id"`
}
EndpointsListChangedEventData Data structure for ENDPOINTS_LIST_CHANGED events. This event would arrive whenever the set of endpoints visible to the application, or their respective capabilities and/or routes, change in a tenant.
ENDPOINTS_LIST_CHANGED is only emitted once the application has at least one endpoint of its own in the target tenant. Until that first application-owned endpoint exists, changes to other endpoints in the tenant are not reported, even if an authorization is in place. Once the first own endpoint is created, clients receive events for any subsequent change to the visible endpoint set.
type EndpointsListResponse ¶ added in v0.8.0
type EndpointsListResponse struct {
Endpoints []TenantEndpointInfo `json:"endpoints"`
}
EndpointsListResponse defines model for EndpointsListResponse.
type ErrorResponse ¶ added in v0.4.0
type ErrorResponse struct {
// Message A human-readable error message describing what went wrong.
Message string `json:"message"`
}
ErrorResponse defines model for ErrorResponse.
type FileReceivedEventData ¶ added in v0.2.0
type FileReceivedEventData struct {
EventType string `json:"event_type"`
// Filename Optional name of the file that is attached to messages as metadata.
Filename *string `json:"filename,omitempty"`
// MessageIds List of agrirouter message IDs of the messages that carried the file payload chunks.
// This is useful for confirming the messages after processing the file.
MessageIds []openapi_types.UUID `json:"message_ids"`
// MessageType The message type of the received payload.
// See available types here:
// https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html
MessageType string `json:"message_type"`
// Payload The payload of the file, base64 encoded.
// Only one of `payload` or `payload_uri` can be present.
Payload *[]byte `json:"payload,omitempty"`
// PayloadUri The URI to access the payload. May have hostname that is different from
// the API server, as payloads may be served from a different server or CDN.
// Clients MUST use provided URI as is without any modifications.
// If event embeds payload directly, this field would be absent.
PayloadUri *PayloadURI `json:"payload_uri,omitempty"`
// ReceivingEndpointId Internally-generated agrirouter ID of the receiving endpoint.
ReceivingEndpointId openapi_types.UUID `json:"receiving_endpoint_id"`
// Size The size of file payload in bytes.
Size int64 `json:"size"`
// TeamsetContextId The teamset context ID that was provided by sending application when sending the message, if any.
TeamsetContextId *string `json:"teamset_context_id,omitempty"`
// TenantId The tenant ID of the to which receiving endpoint belongs. This is useful for confirming messages back to agrirouter.
TenantId *string `json:"tenant_id,omitempty"`
}
FileReceivedEventData Data structure for FILE_RECEIVED events. This event shall arrive whenever a big file transfer has completed in its entirety, i.e when big payload was sent as several message chunks, this event would be sent last when the complete payload is received.
To read payload from this event when using the `payload_uri` field to download the complete payload, it is not required to provide Authorization for this request, as the URI itself contains access to that specific payload.
These URIs are time-limited and would expire after at most 15 minutes, so clients should download the payload before that happens.
type GenericEventData ¶ added in v0.2.0
type GenericEventData struct {
// contains filtered or unexported fields
}
GenericEventData defines model for GenericEventData.
func (GenericEventData) AsAuthorizationAddedEventData ¶ added in v0.8.0
func (t GenericEventData) AsAuthorizationAddedEventData() (AuthorizationAddedEventData, error)
AsAuthorizationAddedEventData returns the union data inside the GenericEventData as a AuthorizationAddedEventData
func (GenericEventData) AsAuthorizationRevokedEventData ¶ added in v0.8.0
func (t GenericEventData) AsAuthorizationRevokedEventData() (AuthorizationRevokedEventData, error)
AsAuthorizationRevokedEventData returns the union data inside the GenericEventData as a AuthorizationRevokedEventData
func (GenericEventData) AsEndpointDeletedEventData ¶ added in v0.6.0
func (t GenericEventData) AsEndpointDeletedEventData() (EndpointDeletedEventData, error)
AsEndpointDeletedEventData returns the union data inside the GenericEventData as a EndpointDeletedEventData
func (GenericEventData) AsEndpointsListChangedEventData ¶ added in v0.8.0
func (t GenericEventData) AsEndpointsListChangedEventData() (EndpointsListChangedEventData, error)
AsEndpointsListChangedEventData returns the union data inside the GenericEventData as a EndpointsListChangedEventData
func (GenericEventData) AsFileReceivedEventData ¶ added in v0.2.0
func (t GenericEventData) AsFileReceivedEventData() (FileReceivedEventData, error)
AsFileReceivedEventData returns the union data inside the GenericEventData as a FileReceivedEventData
func (GenericEventData) AsMessageReceivedEventData ¶ added in v0.2.0
func (t GenericEventData) AsMessageReceivedEventData() (MessageReceivedEventData, error)
AsMessageReceivedEventData returns the union data inside the GenericEventData as a MessageReceivedEventData
func (GenericEventData) Discriminator ¶ added in v0.2.0
func (t GenericEventData) Discriminator() (string, error)
func (*GenericEventData) FromAuthorizationAddedEventData ¶ added in v0.8.0
func (t *GenericEventData) FromAuthorizationAddedEventData(v AuthorizationAddedEventData) error
FromAuthorizationAddedEventData overwrites any union data inside the GenericEventData as the provided AuthorizationAddedEventData
func (*GenericEventData) FromAuthorizationRevokedEventData ¶ added in v0.8.0
func (t *GenericEventData) FromAuthorizationRevokedEventData(v AuthorizationRevokedEventData) error
FromAuthorizationRevokedEventData overwrites any union data inside the GenericEventData as the provided AuthorizationRevokedEventData
func (*GenericEventData) FromEndpointDeletedEventData ¶ added in v0.6.0
func (t *GenericEventData) FromEndpointDeletedEventData(v EndpointDeletedEventData) error
FromEndpointDeletedEventData overwrites any union data inside the GenericEventData as the provided EndpointDeletedEventData
func (*GenericEventData) FromEndpointsListChangedEventData ¶ added in v0.8.0
func (t *GenericEventData) FromEndpointsListChangedEventData(v EndpointsListChangedEventData) error
FromEndpointsListChangedEventData overwrites any union data inside the GenericEventData as the provided EndpointsListChangedEventData
func (*GenericEventData) FromFileReceivedEventData ¶ added in v0.2.0
func (t *GenericEventData) FromFileReceivedEventData(v FileReceivedEventData) error
FromFileReceivedEventData overwrites any union data inside the GenericEventData as the provided FileReceivedEventData
func (*GenericEventData) FromMessageReceivedEventData ¶ added in v0.2.0
func (t *GenericEventData) FromMessageReceivedEventData(v MessageReceivedEventData) error
FromMessageReceivedEventData overwrites any union data inside the GenericEventData as the provided MessageReceivedEventData
func (GenericEventData) MarshalJSON ¶ added in v0.2.0
func (t GenericEventData) MarshalJSON() ([]byte, error)
func (*GenericEventData) MergeAuthorizationAddedEventData ¶ added in v0.8.0
func (t *GenericEventData) MergeAuthorizationAddedEventData(v AuthorizationAddedEventData) error
MergeAuthorizationAddedEventData performs a merge with any union data inside the GenericEventData, using the provided AuthorizationAddedEventData
func (*GenericEventData) MergeAuthorizationRevokedEventData ¶ added in v0.8.0
func (t *GenericEventData) MergeAuthorizationRevokedEventData(v AuthorizationRevokedEventData) error
MergeAuthorizationRevokedEventData performs a merge with any union data inside the GenericEventData, using the provided AuthorizationRevokedEventData
func (*GenericEventData) MergeEndpointDeletedEventData ¶ added in v0.6.0
func (t *GenericEventData) MergeEndpointDeletedEventData(v EndpointDeletedEventData) error
MergeEndpointDeletedEventData performs a merge with any union data inside the GenericEventData, using the provided EndpointDeletedEventData
func (*GenericEventData) MergeEndpointsListChangedEventData ¶ added in v0.8.0
func (t *GenericEventData) MergeEndpointsListChangedEventData(v EndpointsListChangedEventData) error
MergeEndpointsListChangedEventData performs a merge with any union data inside the GenericEventData, using the provided EndpointsListChangedEventData
func (*GenericEventData) MergeFileReceivedEventData ¶ added in v0.2.0
func (t *GenericEventData) MergeFileReceivedEventData(v FileReceivedEventData) error
MergeFileReceivedEventData performs a merge with any union data inside the GenericEventData, using the provided FileReceivedEventData
func (*GenericEventData) MergeMessageReceivedEventData ¶ added in v0.2.0
func (t *GenericEventData) MergeMessageReceivedEventData(v MessageReceivedEventData) error
MergeMessageReceivedEventData performs a merge with any union data inside the GenericEventData, using the provided MessageReceivedEventData
func (*GenericEventData) UnmarshalJSON ¶ added in v0.2.0
func (t *GenericEventData) UnmarshalJSON(b []byte) error
func (GenericEventData) ValueByDiscriminator ¶ added in v0.2.0
func (t GenericEventData) ValueByDiscriminator() (interface{}, error)
type MessageConfirmation ¶ added in v0.4.0
type MessageConfirmation struct {
// EndpointId The agrirouter endpoint ID that received the message.
EndpointId openapi_types.UUID `json:"endpoint_id"`
// MessageId The agrirouter message ID of the confirmed message.
MessageId openapi_types.UUID `json:"message_id"`
}
MessageConfirmation defines model for MessageConfirmation.
type MessageReceivedEventData ¶ added in v0.2.0
type MessageReceivedEventData struct {
// AppMessageId The application message ID of the received message, generated based on application input.
AppMessageId string `json:"app_message_id"`
EventType string `json:"event_type"`
// Filename Optional name of the file that is attached to messages as metadata.
Filename *string `json:"filename,omitempty"`
// Id The agrirouter message ID of the received message, generated by agrirouter.
Id openapi_types.UUID `json:"id"`
// MessageType The message type of the received message.
// See available types here:
// https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html
MessageType string `json:"message_type"`
// Payload The payload of the message, base64 encoded. Only one of `payload` or `payload_uri` would be present.
Payload *[]byte `json:"payload,omitempty"`
// PayloadUri The URI to access the payload. May have hostname that is different from
// the API server, as payloads may be served from a different server or CDN.
// Clients MUST use provided URI as is without any modifications.
// If event embeds payload directly, this field would be absent.
PayloadUri *PayloadURI `json:"payload_uri,omitempty"`
// ReceivedAt The timestamp when the message was received by agrirouter.
ReceivedAt *time.Time `json:"received_at,omitempty"`
// ReceivingEndpointId Internally-generated agrirouter ID of the receiving endpoint.
ReceivingEndpointId openapi_types.UUID `json:"receiving_endpoint_id"`
// SentAt The timestamp when the message was sent by sending application.
SentAt time.Time `json:"sent_at"`
// TeamsetContextId The teamset context ID that was provided by sending application when sending the message, if any.
TeamsetContextId *string `json:"teamset_context_id,omitempty"`
// TenantId The tenant ID of the to which receiving endpoint belongs. This is useful for confirming messages back to agrirouter.
TenantId *string `json:"tenant_id,omitempty"`
}
MessageReceivedEventData Data structure for MESSAGE_RECEIVED events. This event would arrive whenever application got a message routed to one of its endpoints.
type PayloadURI ¶ added in v0.2.0
type PayloadURI = string
PayloadURI The URI to access the payload. May have hostname that is different from the API server, as payloads may be served from a different server or CDN. Clients MUST use provided URI as is without any modifications. If event embeds payload directly, this field would be absent.
type PutEndpointJSONRequestBody ¶
type PutEndpointJSONRequestBody = PutEndpointRequest
PutEndpointJSONRequestBody defines body for PutEndpoint for application/json ContentType.
type PutEndpointParams ¶
type PutEndpointParams struct {
// XAgrirouterTenantId The farmer's tenant ID in relation to which communication is done.
XAgrirouterTenantId XAgrirouterTenantId `json:"x-agrirouter-tenant-id"`
}
PutEndpointParams defines parameters for PutEndpoint.
type PutEndpointRequest ¶
type PutEndpointRequest struct {
// AllowDeleteByUser Flag indicating whether the user is allowed to delete this endpoint.
// Note that even when this flag is not set, the user can still force deletion of the endpoint. Applications must handle the ENDPOINT_DELETED event on a best-effort basis. It is also possible that an endpoint is deleted immediately after creation due to a race with the user disconnecting the entire application, so applications should not rely on this flag to prevent endpoint deletion entirely.
AllowDeleteByUser *bool `json:"allow_delete_by_user,omitempty"`
// ApplicationId The ID of the application that owns the endpoint
ApplicationId openapi_types.UUID `json:"application_id"`
// Capabilities The effective capabilities of the endpoint, must be subset of the capabilities of software version.
Capabilities []EndpointCapability `json:"capabilities"`
// ConnectionsUri URI pointing to where the user can manage the entity connected to this endpoint, e.g. to disconnect or delete equipment from an equipment vendor. When provided, this URI will be shown when the user attempts to delete the endpoint, instead of the usual deletion dialog, directing them to the vendor's management page.
ConnectionsUri *string `json:"connections_uri,omitempty"`
EndpointType EndpointType `json:"endpoint_type"`
// Name Optional name of the endpoint, for easier identification in agrirouter web interface.
// Does not have to be unique.
// If not specified, the name would be generated automatically.
//
// When provided, must be 1-200 characters long and may contain letters from any
// script, digits, spaces, and the following special characters: `-`, `_`, `.`, `,`, `:`.
// Names consisting only of whitespace are not allowed as well, which is not
// expressed in the regex pattern.
//
// It is not guaranteed that this "application-set" name would be used,
// because user may override it with "user-set" name in agrirouter web interface.
// Name send via this API cannot override "user-set" name, but
// it can update "application-set" name at any time and user can choose to
// switch name back to "application-set".
Name *string `json:"name,omitempty"`
// SoftwareVersionId The ID of the software version that owns the endpoint
SoftwareVersionId openapi_types.UUID `json:"software_version_id"`
Subscriptions []EndpointSubscription `json:"subscriptions"`
}
PutEndpointRequest defines model for PutEndpointRequest.
type ReceiveEventsParams ¶ added in v0.2.0
type ReceiveEventsParams struct {
// Types Events type filter, if provided would limit the events returned to only those of the specified types.
// If not provided, all supported events will be streamed.
Types *[]ReceiveEventsParamsTypes `form:"types,omitempty" json:"types,omitempty"`
}
ReceiveEventsParams defines parameters for ReceiveEvents.
type ReceiveEventsParamsTypes ¶ added in v0.2.0
type ReceiveEventsParamsTypes string
ReceiveEventsParamsTypes defines parameters for ReceiveEvents.
const ( AUTHORIZATIONADDED ReceiveEventsParamsTypes = "AUTHORIZATION_ADDED" AUTHORIZATIONREVOKED ReceiveEventsParamsTypes = "AUTHORIZATION_REVOKED" ENDPOINTDELETED ReceiveEventsParamsTypes = "ENDPOINT_DELETED" ENDPOINTSLISTCHANGED ReceiveEventsParamsTypes = "ENDPOINTS_LIST_CHANGED" FILERECEIVED ReceiveEventsParamsTypes = "FILE_RECEIVED" MESSAGERECEIVED ReceiveEventsParamsTypes = "MESSAGE_RECEIVED" )
Defines values for ReceiveEventsParamsTypes.
type RoutedEndpoints ¶ added in v0.8.0
type RoutedEndpoints struct {
// CanReceiveFrom Map keyed by agrirouter endpoint ID. Each value lists the message types
// for which routing is currently possible between the two endpoints.
CanReceiveFrom *EndpointRouteMap `json:"can_receive_from,omitempty"`
// CanSendTo Map keyed by agrirouter endpoint ID. Each value lists the message types
// for which routing is currently possible between the two endpoints.
CanSendTo *EndpointRouteMap `json:"can_send_to,omitempty"`
}
RoutedEndpoints Route-derived information for this endpoint.
This property only exists for endpoints owned by the authorized application. It is omitted for all other endpoints in the tenant.
type SendMessagesParams ¶
type SendMessagesParams struct {
// ContentLength The size of the complete payload in bytes.
// This is used to determine if the payload needs to be
// split into chunks and how.
ContentLength int64 `json:"content-length"`
// XAgrirouterIsPublish If set to true, the message will be sent as a published message
// and any endpoints that are subscribed to the message type
// would be able to receive it, provided other conditions for routing are met.
XAgrirouterIsPublish bool `json:"x-agrirouter-is-publish"`
// XAgrirouterDirectRecipients Comma-separated list of agrirouter endpoint IDs of the direct recipients.
// Allows specifying direct recipients of the message, which
// could receive it even if they are not subscribed to the message type.
XAgrirouterDirectRecipients *[]openapi_types.UUID `json:"x-agrirouter-direct-recipients,omitempty"`
// XAgrirouterSentTimestamp Client side timestamp of sending the data.
XAgrirouterSentTimestamp time.Time `json:"x-agrirouter-sent-timestamp"`
// XAgrirouterEndpointId The agrirouter endpoint ID of the sender.
// This is the ID of the endpoint that is sending the message.
XAgrirouterEndpointId openapi_types.UUID `json:"x-agrirouter-endpoint-id"`
// XAgrirouterTeamsetContextId A teamset is a set of connected machines that work and move together
// and are connected to the same (virtual) communication unit.
// The machines in the teamset are typically connected physically and
// informationally (for example via ISOBUS).
XAgrirouterTeamsetContextId *string `json:"x-agrirouter-teamset-context-id,omitempty"`
// XAgrirouterMessageType Message type of the sent data. See available types here:
// https://docs.agrirouter.com/agrirouter-interface-documentation/latest/tmt/overview.html
XAgrirouterMessageType string `json:"x-agrirouter-message-type"`
// XAgrirouterTenantId The farmer's tenant ID in relation to which communication is done.
XAgrirouterTenantId XAgrirouterTenantId `json:"x-agrirouter-tenant-id"`
// XAgrirouterContextId Application side identifier of the sent data.
// agrirouter will use this to generate application message id
// and also will pass it on as chunk context id in case if the payload
// had to be split into several messages.
// This has to be generated by the application and be unique for
// every sent payload. Applications may want to reuse the same id
// in case if they are resending the same payload again, when f.e
// retrying after a failure.
XAgrirouterContextId string `json:"x-agrirouter-context-id"`
// XAgrirouterFilename Optional name of the file that is attached to messages as metadata.
XAgrirouterFilename *string `json:"x-agrirouter-filename,omitempty"`
}
SendMessagesParams defines parameters for SendMessages.
type TenantEndpointCapabilities ¶ added in v0.8.0
type TenantEndpointCapabilities struct {
// CanReceive Message types this endpoint can receive.
CanReceive []string `json:"can_receive"`
// CanSend Message types this endpoint can send.
CanSend []string `json:"can_send"`
}
TenantEndpointCapabilities defines model for TenantEndpointCapabilities.
type TenantEndpointInfo ¶ added in v0.8.0
type TenantEndpointInfo struct {
// ApplicationId The ID of the application that owns the endpoint.
ApplicationId openapi_types.UUID `json:"application_id"`
Capabilities TenantEndpointCapabilities `json:"capabilities"`
EndpointType EndpointType `json:"endpoint_type"`
// ExternalId External identifier of the endpoint, if available to the caller.
ExternalId *string `json:"external_id,omitempty"`
// Id The agrirouter endpoint ID.
Id openapi_types.UUID `json:"id"`
// Name Display name of the endpoint.
Name string `json:"name"`
// OwnedByYourApplication Indicates whether this endpoint belongs to the application that is authorized for the current request.
OwnedByYourApplication bool `json:"owned_by_your_application"`
// RoutedEndpoints Route-derived information for this endpoint.
//
// This property only exists for endpoints owned by the authorized
// application. It is omitted for all other endpoints in the tenant.
RoutedEndpoints *RoutedEndpoints `json:"routed_endpoints,omitempty"`
// TenantId The tenant ID of the endpoint.
TenantId openapi_types.UUID `json:"tenant_id"`
}
TenantEndpointInfo defines model for TenantEndpointInfo.
type TenantId ¶ added in v0.8.0
type TenantId = openapi_types.UUID
TenantId defines model for tenantId.
type TenantInfo ¶ added in v0.8.0
type TenantInfo struct {
// Endpoints Endpoints visible in this tenant, subject to the following
// privacy rule:
//
// - If the application has not yet created any endpoint of its own
// in this tenant, this array is empty — even if other endpoints
// exist in the tenant. This prevents exposing tenant contents to
// applications that have not yet actively participated in it.
// - Once the application has at least one of its own endpoints in
// the tenant, this array contains the full set of endpoints
// visible to the application.
//
// An authorized tenant with no application-owned endpoint will
// therefore still appear in `GET /tenants`, but with an empty
// `endpoints` array. See `owned_by_your_application` on
// `TenantEndpointInfo` for the distinction between own and other
// endpoints.
Endpoints []TenantEndpointInfo `json:"endpoints"`
// TenantId Authorized tenant ID.
TenantId openapi_types.UUID `json:"tenant_id"`
}
TenantInfo defines model for TenantInfo.
type TenantsListResponse ¶ added in v0.8.0
type TenantsListResponse struct {
Tenants []TenantInfo `json:"tenants"`
}
TenantsListResponse defines model for TenantsListResponse.
type XAgrirouterTenantId ¶
type XAgrirouterTenantId = openapi_types.UUID
XAgrirouterTenantId defines model for x-agrirouter-tenant-id.