From b84799c02fb846fa4b456d1eb0589b531162d6d9 Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Wed, 5 Jun 2024 13:07:24 +0000 Subject: [PATCH 01/14] Connect golib Signed-off-by: Bashorun97 --- .gitignore | 1 + .gitpod.yml | 11 ++ connect/big_encode.json | 0 connect/filename.json | 1 + connect/main.go | 225 ++++++++++++++++++++++++++++++++++++++++ connect/main_test.go | 0 connect/types.go | 163 +++++++++++++++++++++++++++++ go.mod | 1 + go.sum | 2 + 9 files changed, 404 insertions(+) create mode 100644 .gitignore create mode 100644 .gitpod.yml create mode 100755 connect/big_encode.json create mode 100644 connect/filename.json create mode 100644 connect/main.go create mode 100644 connect/main_test.go create mode 100644 connect/types.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..baedb4e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.gitpod.yaml \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..29c34fc --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,11 @@ +# This configuration file was automatically generated by Gitpod. +# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) +# and commit this file to your remote git repository to share the goodness with others. + +# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart + +tasks: + - init: go get && go build ./... && go test ./... + command: go run . + + diff --git a/connect/big_encode.json b/connect/big_encode.json new file mode 100755 index 0000000..e69de29 diff --git a/connect/filename.json b/connect/filename.json new file mode 100644 index 0000000..df90e5e --- /dev/null +++ b/connect/filename.json @@ -0,0 +1 @@ +{"__schema":{"types":[{"kind":"OBJECT","name":"Activity","description":"","fields":[{"name":"id","description":"Unique identifier for the activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"metadata","description":"Metadata associated with the activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[{"kind":"OBJECT","name":"NetflixActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"PlaystationActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"AmazonActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"YoutubeActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"UberActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"InstacartActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"ofType":null},{"kind":"OBJECT","name":"ActivityResponse","description":"","fields":[{"name":"data","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Activity","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"limit","description":"The maximum number of activities to retrieve (limit: 300).","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"total","description":"The total number of available activities in the dataset.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"page","description":"The page number from which activities are being pulled.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"AmazonActivityMetadata","description":"","fields":[{"name":"productName","description":"The product name of the Amazon activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating when the activity occurred.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"quantityPurchased","description":"Quantity of item purchased","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"totalCost","description":"Total cost of purchased product","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Application","description":"Represents a registered application within the system, encapsulating all relevant details\nthat identify and describe the application.","fields":[{"name":"appName","description":"The human-readable name of the application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"publicKey","description":"A public key associated with the application, used for cryptographic operations such as\nverifying the identity of the application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"iconURL","description":"The URL pointing to the icon graphic for the application. This URL should link to an image\nthat visually represents the application, aiding in its identification and branding.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"gandalfID","description":"A unique identifier assigned to the application upon registration.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"appRegistrar","description":"The address of the user who registered the application. ","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Boolean","description":"The `Boolean` scalar type represents `true` or `false`.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"ContentType","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"VIDEO","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SHORTS","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MUSIC","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Date","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Float","description":"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"ID","description":"The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as \"4\") or integer (such as 4) input value will be accepted as an ID.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Identifier","description":"","fields":[{"name":"value","description":"The string value of the identifier.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"identifierType","description":"The type of the identifier (enumeration)","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"IdentifierType","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"IdentifierType","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"IMDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MOBY","description":"","isDeprecated":false,"deprecationReason":""},{"name":"RAWG","description":"","isDeprecated":false,"deprecationReason":""},{"name":"IGDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ASIN","description":"","isDeprecated":false,"deprecationReason":""},{"name":"PLAYSTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"YOUTUBE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TVDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TVMAZE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UBER","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INSTACART","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"InstacartActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"retailer","description":"The name of the ratailer that handled the order.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"totalOrderAmountSpent","description":"The total amount spent on this order.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dateOrdered","description":"The date the order was placed","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dateDelivered","description":"The date the order was delivered","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"statusString","description":"String indicating the status of the order","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"items","description":"List of items ordered.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"InstacartOrderItem","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"InstacartItemStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"FOUND","description":"","isDeprecated":false,"deprecationReason":""},{"name":"REPLACED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TOREFUND","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"InstacartOrderItem","description":"","fields":[{"name":"itemID","description":"The Instacart ID of the item","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"productName","description":"The name of the ordered item.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"unitPrice","description":"The price per unit e.g (1.39 • 1 gal).","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"status","description":"Enum indicating the status of the ordered item e.g found","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"InstacartItemStatus","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"quantityPurchased","description":"The quantity purchased.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"InstacartOrderStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"COMPLETE","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Int","description":"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Int64","description":"Scalar type representing a 64-bit signed integer.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"JSON","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Map","description":"Scalar type representing a map data structure.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"NetflixActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Netflix activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating when the activity occurred , formatted as (DD/MM/YYYY).","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":true,"deprecationReason":"use lastPlayedAt","args":[]},{"name":"lastPlayedAt","description":"Date indicating when the activity was last played , formatted as (DD/MM/YYYY).","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"PlaystationActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Playstation activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"lastPlayedAt","description":"Date indicating the last time game was played.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Query","description":"","fields":[{"name":"getActivity","description":"Retrieves a paginated list of activities based on a given data key and source.\n\nReturns: A response object containing a list of activities, along with pagination information.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"ActivityResponse","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"dataKey","description":"A unique key that is generated after a user has completed the data submission flow.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"source","description":"A unique key that is generated after a user has completed the data submission flow.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"Source","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"limit","description":"The maximum number of activities to return in a single response.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"page","description":"The page number of the activity list to retrieve, allowing for pagination through large sets of data.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"lookupActivity","description":"Looks up a specific activity by its unique identifier (ID) and a data key.\n\nReturns: An Activity object containing detailed information about the requested activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Activity","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"dataKey","description":"A unique key that is generated after a user has completed the data submission flow. ","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"activityId","description":"The unique identifier (UUID) of the activity to retrieve.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"UUID","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"getAppByPublicKey","description":"Retrieves an application by its public key.\n\nReturns: An Application object that includes detailed information about the requested application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Application","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"publicKey","description":"The public key associated with the desired application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"Source","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"NETFLIX","description":"","isDeprecated":false,"deprecationReason":""},{"name":"PLAYSTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"YOUTUBE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"AMAZON","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UBER","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INSTACART","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"String","description":"The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Time","description":"Scalar type representing a specific point in time.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"TripStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"CANCELED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"COMPLETED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNFULFILLED","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"UUID","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"UberActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"beginTripTime","description":"This indicates the start time of the trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Time","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dropoffTime","description":"This indicates the end time of the trip","type":{"kind":"SCALAR","name":"Time","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"cost","description":"A string indicating the cost of the trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"city","description":"A string indicating the city the trip originated from","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"distance","description":"Distance covered from pickup to dropoff location","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"status","description":"Enum indicating the status of a trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"TripStatus","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"YoutubeActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Youtube activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating the last time the Youtube video was played.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"percentageWatched","description":"An integer indicating what percentage of the entire video duration watched.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"contentType","description":"Enum denoting the type of the youtube activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"ContentType","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Directive","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"locations","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"args","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isRepeatable","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"__DirectiveLocation","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"QUERY","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MUTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SUBSCRIPTION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FIELD","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FRAGMENT_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FRAGMENT_SPREAD","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INLINE_FRAGMENT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"VARIABLE_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SCHEMA","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SCALAR","description":"","isDeprecated":false,"deprecationReason":""},{"name":"OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FIELD_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ARGUMENT_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INTERFACE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM_VALUE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_FIELD_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__EnumValue","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isDeprecated","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"deprecationReason","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Field","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"args","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"type","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isDeprecated","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"deprecationReason","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__InputValue","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"type","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"defaultValue","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Schema","description":"","fields":[{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"types","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"queryType","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"mutationType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subscriptionType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"directives","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Directive","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Type","description":"","fields":[{"name":"kind","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"__TypeKind","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"name","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"fields","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Field","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"includeDeprecated","description":"","type":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"false","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"interfaces","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"possibleTypes","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"enumValues","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"includeDeprecated","description":"","type":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"false","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"inputFields","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"ofType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"specifiedByURL","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"__TypeKind","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"SCALAR","description":"","isDeprecated":false,"deprecationReason":""},{"name":"OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INTERFACE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"LIST","description":"","isDeprecated":false,"deprecationReason":""},{"name":"NON_NULL","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null}]}} \ No newline at end of file diff --git a/connect/main.go b/connect/main.go new file mode 100644 index 0000000..c8f8dc3 --- /dev/null +++ b/connect/main.go @@ -0,0 +1,225 @@ +package main + +import ( + "context" + "encoding/json" + "encoding/base64" + "fmt" + "log" + "strings" + "net/url" + "github.com/skip2/go-qrcode" + + graphqlClient "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphql" +) + +const APP_CLIP_BASE_URL = "https://appclip.apple.com/id?p=network.gandalf.connect.Clip" +const SAURON_BASE_URL = "https://sauron.gandalf.network/public/gql" + +const ( + InvalidService GandalfErrorCode = iota + InvalidPublicKey + InvalidRedirectURL + QRCodeGenNotSupported + QRCodeNotGenerated +) + +func (e *GandalfError) Error() string { + return fmt.Sprintf("%s (code: %d)", e.Message, e.Code) +} + +func GenerateURL(publicKey string, redirectURL string, input Services) (string, error) { + services, err := runValidation(publicKey, redirectURL, input) + if err != nil { + return "", err + } + + servicesJSON := servicesToJSON(services) + + return encodeComponents(servicesJSON, publicKey, redirectURL), nil +} + +func GenerateQRCode(publicKey string, redirectURL string, input Services) (string, error) { + if publicKey == "" || redirectURL == "" || input == nil { + return "", &GandalfError{ + Message: "Invalid input parameters", + Code: QRCodeGenNotSupported, + } + } + + services, err := runValidation(publicKey, redirectURL, input) + if err != nil { + return "", err + } + + servicesJSON := servicesToJSON(services) + appClipURL := encodeComponents(servicesJSON, redirectURL, publicKey) + + qrCode, err := qrcode.New(appClipURL, qrcode.Medium) + if err != nil { + return "", &GandalfError{ + Message: "QRCode Generation Error", + Code: QRCodeNotGenerated, + } + } + + qrCodeData, err := qrCode.PNG(256) + if err != nil { + return "", &GandalfError{ + Message: "QRCode Generation Error", + Code: QRCodeNotGenerated, + } + } + qrCodeURL := fmt.Sprintf("data:image/png;base64,%s", base64.StdEncoding.EncodeToString(qrCodeData)) + return qrCodeURL, nil +} + +func introspectSauron() IntrospectionResult { + client := graphqlClient.NewClient(SAURON_BASE_URL) + req := graphqlClient.NewRequest(introspectionQuery) + + ctx := context.Background() + + var respData IntrospectionResult + + if err := client.Run(ctx, req, &respData); err != nil { + log.Fatalf("Error making introspection query: %v", err) + } + return respData +} + +func validateRedirectURL(rawURL string) error { + _, err := url.ParseRequestURI(rawURL) + if err != nil { + return &GandalfError{ + Message: "Invalid redirect URL", + Code: InvalidRedirectURL, + } + } + return nil +} + +func validatePublicKey(publicKey string) bool { + return publicKeyRequest(publicKey) +} + +func getSupportedServices() interface{} { + gqlSchema := introspectSauron() + for _, val := range gqlSchema.Schema.Types { + if val.Kind == "ENUM" && val.Name == "Source" { + return val.EnumValues + } + } + return nil +} + +func validateInputServices(input Services) (map[string]Service, error) { + supportedServicesInterface := getSupportedServices() + supportedServices := supportedServicesInterface.(SupportedServices) + + serviceMap := make(map[string]SupportedService) + for _, val := range supportedServices { + serviceMap[val.Name] = val + } + + var unsupportedServices []string + requiredServices := 0 + cleanedServices := make(map[string]Service) + for _, val := range input { + key := strings.ToUpper(val.Name) + if _, found := serviceMap[key]; !found { + unsupportedServices = append(unsupportedServices, key) + continue + } + + if val.Name != "" { + requiredServices++ + } + cleanedServices[key] = val + } + + if len(unsupportedServices) > 0 { + return nil, &GandalfError{ + Message: fmt.Sprintf("These services %s are unsupported", strings.Join(unsupportedServices, " ")), + Code: InvalidService, + } + } + + if requiredServices < 1 { + return nil, &GandalfError{ + Message: "At least one service has to be required", + Code: InvalidService, + } + } + + return cleanedServices, nil + +} + +func publicKeyRequest(publicKey string) bool { + graphqlRequest := graphqlClient.NewRequest(` + query GetAppByPublicKey($publicKey: String!) { + getAppByPublicKey(publicKey: $publicKey) { + appName + gandalfID + } + } + `) + + graphqlRequest.Var("publicKey", publicKey) + + client := graphqlClient.NewClient(SAURON_BASE_URL) + + ctx := context.Background() + + var respData Application + + if err := client.Run(ctx, graphqlRequest, &respData); err != nil { + log.Fatalf("Error making introspection query: %v", err) + } + + return respData.GandalfID > 0 +} + +func runValidation(publicKey string, redirectURL string, input Services) (map[string]Service, error) { + isPublicKeyValid := validatePublicKey(publicKey) + if !isPublicKeyValid { + return nil, &GandalfError{ + Message: "Public key does not exist", + Code: InvalidPublicKey, + } + } + + err := validateRedirectURL(redirectURL) + if err != nil { + fmt.Println("Error:", err) + return nil, err + } + + services, err := validateInputServices(input) + if err != nil { + return nil, err + } + return services, nil +} + +func encodeComponents(servicesJSON []byte, publicKey string, redirectURL string) string { + encodedServices := url.QueryEscape(string(servicesJSON)) + encodedRedirectURL := url.QueryEscape(redirectURL) + encodedPublicKey := url.QueryEscape(publicKey) + + return fmt.Sprintf("%s&services=%s&redirectUrl=%s&publicKey=%s", APP_CLIP_BASE_URL, encodedServices, encodedRedirectURL, encodedPublicKey) +} + +func servicesToJSON(services map[string]Service) []byte { + var servicesSlice []Service + for _, service := range services { + servicesSlice = append(servicesSlice, service) + } + + servicesJSON, err := json.Marshal(servicesSlice) + if err != nil { + log.Fatalf("Error marshaling JSON: %v", err) + } + return servicesJSON +} \ No newline at end of file diff --git a/connect/main_test.go b/connect/main_test.go new file mode 100644 index 0000000..e69de29 diff --git a/connect/types.go b/connect/types.go new file mode 100644 index 0000000..704a864 --- /dev/null +++ b/connect/types.go @@ -0,0 +1,163 @@ +package main + + +type GandalfErrorCode int + +// GandalfError is a custom error type for validation errors +type GandalfError struct { + Message string + Code GandalfErrorCode +} + +type Application struct { + GandalfID int64 +} + +type SupportedService struct { + Name string `json:"name"` + Description string `json:"description"` + IsDeprecated bool `json:"isDeprecated"` + DeprecationReason string `json:"deprecationReason"` +} + +type SupportedServices []SupportedService + +type Service struct { + Name string + Status bool +} + +type Services []Service + +// Type represents a GraphQL type with various properties like kind, name, description, etc. +type Type struct { + Kind string `json:"kind"` + Name string `json:"name"` + Description string `json:"description"` + Fields []Field `json:"fields"` + InputFields []Field `json:"inputFields"` + Interfaces []Type `json:"interfaces"` + EnumValues []Value `json:"enumValues"` + PossibleTypes []Type `json:"possibleTypes"` + OfType *Type `json:"ofType"` +} + +// Field represents a field in a GraphQL type with various properties +type Field struct { + Name string `json:"name"` + Description string `json:"description"` + Type Type `json:"type"` + DefaultValue string `json:"defaultValue"` + IsDeprecated bool `json:"isDeprecated"` + DeprecationReason string `json:"deprecationReason"` + Args []Field `json:"args"` +} + +// Value represents a value in an enum type +type Value struct { + Name string `json:"name"` + Description string `json:"description"` + IsDeprecated bool `json:"isDeprecated"` + DeprecationReason string `json:"deprecationReason"` +} + +// IntrospectionResult represents the schema structure received from the GraphQL introspection query +type IntrospectionResult struct { + Schema struct { + Types []Type `json:"types"` + } `json:"__schema"` +} + +const introspectionQuery = ` + query { + __schema { + types { + kind + name + description + fields(includeDeprecated: true) { + name + description + args { + name + description + type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + defaultValue + } + type { + kind + name + ofType { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + } + isDeprecated + deprecationReason + } + inputFields { + name + description + type { + kind + name + ofType { + kind + name + ofType { + kind + name + } + } + } + defaultValue + } + interfaces { + kind + name + ofType { + kind + name + } + } + enumValues(includeDeprecated: true) { + name + description + isDeprecated + deprecationReason + } + possibleTypes { + kind + name + ofType { + kind + name + } + } + } + } + } +` \ No newline at end of file diff --git a/go.mod b/go.mod index 0b447e0..4940ada 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/gandalf-network/genqlient v1.0.2 github.com/google/uuid v1.6.0 github.com/pkg/errors v0.9.1 + github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e ) require ( diff --git a/go.sum b/go.sum index b8ca45e..03639e9 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= +github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= From d7bb170e6d04e55e57885e61dbda50bc17eeb8ce Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Wed, 5 Jun 2024 23:49:11 +0000 Subject: [PATCH 02/14] Connect example Signed-off-by: Bashorun97 --- connect/{main.go => connect.go} | 44 ++++++++++++++++++++++----------- connect/example/main.go | 36 +++++++++++++++++++++++++++ connect/main_test.go | 0 connect/types.go | 18 +++++++++++--- go.mod | 1 + 5 files changed, 82 insertions(+), 17 deletions(-) rename connect/{main.go => connect.go} (85%) create mode 100644 connect/example/main.go delete mode 100644 connect/main_test.go diff --git a/connect/main.go b/connect/connect.go similarity index 85% rename from connect/main.go rename to connect/connect.go index c8f8dc3..f536916 100644 --- a/connect/main.go +++ b/connect/connect.go @@ -1,4 +1,4 @@ -package main +package connect import ( "context" @@ -103,7 +103,7 @@ func validatePublicKey(publicKey string) bool { return publicKeyRequest(publicKey) } -func getSupportedServices() interface{} { +func getSupportedServices() []Value { gqlSchema := introspectSauron() for _, val := range gqlSchema.Schema.Types { if val.Kind == "ENUM" && val.Name == "Source" { @@ -114,10 +114,10 @@ func getSupportedServices() interface{} { } func validateInputServices(input Services) (map[string]Service, error) { - supportedServicesInterface := getSupportedServices() - supportedServices := supportedServicesInterface.(SupportedServices) + // supportedServicesInterface := getSupportedServices() + supportedServices := getSupportedServices() - serviceMap := make(map[string]SupportedService) + serviceMap := make(map[string]Value) for _, val := range supportedServices { serviceMap[val.Name] = val } @@ -159,25 +159,41 @@ func validateInputServices(input Services) (map[string]Service, error) { func publicKeyRequest(publicKey string) bool { graphqlRequest := graphqlClient.NewRequest(` query GetAppByPublicKey($publicKey: String!) { - getAppByPublicKey(publicKey: $publicKey) { - appName - gandalfID + getAppByPublicKey( + publicKey: $publicKey + ) { + appName + gandalfID } } `) - graphqlRequest.Var("publicKey", publicKey) - + graphqlRequest.Var("publicKey", publicKey) client := graphqlClient.NewClient(SAURON_BASE_URL) ctx := context.Background() - var respData Application + var graphqlResponse map[string]interface{} - if err := client.Run(ctx, graphqlRequest, &respData); err != nil { - log.Fatalf("Error making introspection query: %v", err) + if err := client.Run(ctx, graphqlRequest, &graphqlResponse); err != nil { + log.Fatalf("Error making publicKey request query: %v", err) } + responseData, ok := graphqlResponse["getAppByPublicKey"].(map[string]interface{}) + if !ok { + log.Fatalf("Unexpected response structure: %v", graphqlResponse) + } + + body, err := json.Marshal(responseData) + if err != nil { + return false + } + + var respData Application + err = json.Unmarshal(body, &respData) + if err != nil { + return false + } return respData.GandalfID > 0 } @@ -185,7 +201,7 @@ func runValidation(publicKey string, redirectURL string, input Services) (map[st isPublicKeyValid := validatePublicKey(publicKey) if !isPublicKeyValid { return nil, &GandalfError{ - Message: "Public key does not exist", + Message: "Invalid public key", Code: InvalidPublicKey, } } diff --git a/connect/example/main.go b/connect/example/main.go new file mode 100644 index 0000000..d88b343 --- /dev/null +++ b/connect/example/main.go @@ -0,0 +1,36 @@ +package main + +import ( + "fmt" + "log" + + "github.com/gandalf-network/gandalf-sdk-go/connect" +) + +const publicKey = "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08"; +const redirectURL = "https://example.com" + + +func main() { + qrCodeServices := connect.Services{ + {Name: "Netflix", Status: true}, + {Name: "Playstation", Status: false}, + } + qrCodeURL, err := connect.GenerateQRCode(publicKey, redirectURL, qrCodeServices) + if err != nil { + log.Fatalf("An error occurred generating QR Code url: %v", err) + } + + fmt.Println("QR Code URL => ", qrCodeURL) + + services := connect.Services{ + {Name: "Netflix", Status: false}, + {Name: "Playstation", Status: true}, + } + url, err := connect.GenerateURL(publicKey, redirectURL, services) + if err != nil { + log.Fatalf("An error occurred url: %v", err) + } + + fmt.Println("URL => ", url) +} \ No newline at end of file diff --git a/connect/main_test.go b/connect/main_test.go deleted file mode 100644 index e69de29..0000000 diff --git a/connect/types.go b/connect/types.go index 704a864..696aa6f 100644 --- a/connect/types.go +++ b/connect/types.go @@ -1,4 +1,4 @@ -package main +package connect type GandalfErrorCode int @@ -10,8 +10,20 @@ type GandalfError struct { } type Application struct { - GandalfID int64 + // The human-readable name of the application. + AppName string `json:"appName"` + // A public key associated with the application, used for cryptographic operations such as + // verifying the identity of the application. + PublicKey string `json:"publicKey"` + // The URL pointing to the icon graphic for the application. This URL should link to an image + // that visually represents the application, aiding in its identification and branding. + IconURL string `json:"iconURL"` + // A unique identifier assigned to the application upon registration. + GandalfID int64 `json:"gandalfID"` + // The address of the user who registered the application. + AppRegistrar string `json:"appRegistrar"` } +// type Application map[string]interface{} type SupportedService struct { Name string `json:"name"` @@ -20,7 +32,7 @@ type SupportedService struct { DeprecationReason string `json:"deprecationReason"` } -type SupportedServices []SupportedService +type SupportedServices []Value type Service struct { Name string diff --git a/go.mod b/go.mod index 4940ada..656b70a 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.22.1 require ( github.com/btcsuite/btcd/btcec/v2 v2.3.3 + github.com/davecgh/go-spew v1.1.1 github.com/gandalf-network/genqlient v1.0.2 github.com/google/uuid v1.6.0 github.com/pkg/errors v0.9.1 From fea918cea6abc5d58ef262c6147f50fc1dcaa543 Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Fri, 7 Jun 2024 04:17:26 +0000 Subject: [PATCH 03/14] Resolve review comments Signed-off-by: Bashorun97 --- .gitignore | 3 +- connect/big_encode.json | 0 connect/connect.go | 215 ++++++++++++++++------- connect/connect_test.go | 1 + connect/example/main.go | 30 ++-- connect/filename.json | 1 - connect/types.go | 111 ++---------- eyeofsauron/{ => constants}/constants.go | 6 +- eyeofsauron/main.go | 5 +- go.mod | 2 +- go.sum | 2 + 11 files changed, 196 insertions(+), 180 deletions(-) delete mode 100755 connect/big_encode.json create mode 100644 connect/connect_test.go delete mode 100644 connect/filename.json rename eyeofsauron/{ => constants}/constants.go (95%) diff --git a/.gitignore b/.gitignore index baedb4e..f83461b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.gitpod.yaml \ No newline at end of file +.gitpod.yaml +.env \ No newline at end of file diff --git a/connect/big_encode.json b/connect/big_encode.json deleted file mode 100755 index e69de29..0000000 diff --git a/connect/connect.go b/connect/connect.go index f536916..94dc9b3 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -2,19 +2,27 @@ package connect import ( "context" - "encoding/json" "encoding/base64" + "encoding/json" "fmt" "log" - "strings" "net/url" - "github.com/skip2/go-qrcode" + "os" + "strings" + "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/constants" + "github.com/skip2/go-qrcode" graphqlClient "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphql" ) -const APP_CLIP_BASE_URL = "https://appclip.apple.com/id?p=network.gandalf.connect.Clip" -const SAURON_BASE_URL = "https://sauron.gandalf.network/public/gql" +var ( + IOS_APP_CLIP_BASE_URL = "https://appclip.apple.com/id?p=network.gandalf.connect.Clip" + ANDROID_APP_CLIP_BASE_URL = os.Getenv("ANDROID_APP_CLIP_BASE_URL") + UNIVERSAL_APP_CLIP_BASE_URL = os.Getenv("UNIVERSAL_APP_CLIP_BASE_URL") + SAURON_BASE_URL = os.Getenv("SAURON_BASE_URL") +) + + const ( InvalidService GandalfErrorCode = iota @@ -22,38 +30,72 @@ const ( InvalidRedirectURL QRCodeGenNotSupported QRCodeNotGenerated + EncodingError ) func (e *GandalfError) Error() string { return fmt.Sprintf("%s (code: %d)", e.Message, e.Code) } -func GenerateURL(publicKey string, redirectURL string, input Services) (string, error) { - services, err := runValidation(publicKey, redirectURL, input) + +type Connect struct { + PublicKey string + RedirectURL string + Platform PlatformType + VerificationStatus bool + Data InputData +} + +func NewConnect(publicKey string, redirectURL string, platform PlatformType, data InputData) (*Connect, error) { + if publicKey == "" || redirectURL == "" { + return nil, fmt.Errorf("invalid parameters") + } + + if platform == "" { + platform = PlatformTypeIOS + } + return &Connect{PublicKey: publicKey, RedirectURL: redirectURL, Data: data}, nil +} + +func (c *Connect) GenerateURL() (string, error) { + services, err := runValidation(c.PublicKey, c.RedirectURL, c.Data, c.VerificationStatus) if err != nil { return "", err } servicesJSON := servicesToJSON(services) - return encodeComponents(servicesJSON, publicKey, redirectURL), nil + url, err := c.encodeComponents(string(servicesJSON), c.RedirectURL, c.PublicKey) + if err != nil { + return "", &GandalfError{ + Message: "Encoding Error", + Code: EncodingError, + } + } + return url, nil } -func GenerateQRCode(publicKey string, redirectURL string, input Services) (string, error) { - if publicKey == "" || redirectURL == "" || input == nil { +func (c *Connect) GenerateQRCode(input InputData) (string, error) { + if input == nil { return "", &GandalfError{ Message: "Invalid input parameters", Code: QRCodeGenNotSupported, } } - services, err := runValidation(publicKey, redirectURL, input) + services, err := runValidation(c.PublicKey, c.RedirectURL, input, c.VerificationStatus) if err != nil { return "", err } servicesJSON := servicesToJSON(services) - appClipURL := encodeComponents(servicesJSON, redirectURL, publicKey) + appClipURL, err := c.encodeComponents(string(servicesJSON), c.RedirectURL, c.PublicKey) + if err != nil { + return "", &GandalfError{ + Message: "Encoding Error", + Code: EncodingError, + } + } qrCode, err := qrcode.New(appClipURL, qrcode.Medium) if err != nil { @@ -76,7 +118,7 @@ func GenerateQRCode(publicKey string, redirectURL string, input Services) (strin func introspectSauron() IntrospectionResult { client := graphqlClient.NewClient(SAURON_BASE_URL) - req := graphqlClient.NewRequest(introspectionQuery) + req := graphqlClient.NewRequest(constants.IntrospectionQuery) ctx := context.Background() @@ -113,29 +155,52 @@ func getSupportedServices() []Value { return nil } -func validateInputServices(input Services) (map[string]Service, error) { - // supportedServicesInterface := getSupportedServices() - supportedServices := getSupportedServices() +func validateInputData(input InputData) (InputData, error) { + services := getSupportedServices() - serviceMap := make(map[string]Value) - for _, val := range supportedServices { - serviceMap[val.Name] = val + cleanServices := make(InputData) + unsupportedServices := []string{} + + keys := make([]string, 0, len(input)) + for key := range input { + keys = append(keys, key) } - var unsupportedServices []string - requiredServices := 0 - cleanedServices := make(map[string]Service) - for _, val := range input { - key := strings.ToUpper(val.Name) - if _, found := serviceMap[key]; !found { + if len(keys) > 1 { + return nil, &GandalfError{ + Message: "Only one service is supported per Connect URL", + Code: InvalidService, + } + } + + for _, key := range keys { + lowerKey := strings.ToUpper(key) + if !contains(services, lowerKey) { unsupportedServices = append(unsupportedServices, key) continue } - - if val.Name != "" { - requiredServices++ + + value := input[key] + switch v := value.(type) { + case bool: + if !v { + return nil, &GandalfError{ + Message: "At least one service has to be required", + Code: InvalidService, + } + } + cleanServices[lowerKey] = v + case Service: + if err := validateInputService(v); err != nil { + return nil, err + } + cleanServices[lowerKey] = v + default: + return nil, &GandalfError{ + Message: fmt.Sprintf("Unsupported value type for key %s", key), + Code: InvalidService, + } } - cleanedServices[key] = val } if len(unsupportedServices) > 0 { @@ -145,15 +210,26 @@ func validateInputServices(input Services) (map[string]Service, error) { } } - if requiredServices < 1 { - return nil, &GandalfError{ - Message: "At least one service has to be required", - Code: InvalidService, + return cleanServices, nil +} + +func contains(slice []Value, item string) bool { + for _, v := range slice { + if v.Name == item { + return true } } + return false +} - return cleanedServices, nil - +func validateInputService(input Service) error { + if (len(input.Activities) < 1) && (len(input.Traits) < 1) { + return &GandalfError{ + Message: "At least one trait or activity is required", + Code: InvalidService, + } + } + return nil } func publicKeyRequest(publicKey string) bool { @@ -197,43 +273,60 @@ func publicKeyRequest(publicKey string) bool { return respData.GandalfID > 0 } -func runValidation(publicKey string, redirectURL string, input Services) (map[string]Service, error) { - isPublicKeyValid := validatePublicKey(publicKey) - if !isPublicKeyValid { - return nil, &GandalfError{ - Message: "Invalid public key", - Code: InvalidPublicKey, +func runValidation(publicKey string, redirectURL string, input InputData, verificationStatus bool) (InputData, error) { + if !verificationStatus { + isPublicKeyValid := validatePublicKey(publicKey) + if !isPublicKeyValid { + return nil, &GandalfError{ + Message: "Invalid public key", + Code: InvalidPublicKey, + } + } + + err := validateRedirectURL(redirectURL) + if err != nil { + return nil, err } + + services, err := validateInputData(input) + if err != nil { + return nil, err + } + return services, nil } + return nil, nil +} - err := validateRedirectURL(redirectURL) - if err != nil { - fmt.Println("Error:", err) - return nil, err + +func (c *Connect) encodeComponents(data, redirectUrl string, publicKey string) (string, error) { + var baseURL string + switch c.Platform { + case PlatformTypeAndroid: + baseURL = ANDROID_APP_CLIP_BASE_URL + case PlatformUniversal: + baseURL = UNIVERSAL_APP_CLIP_BASE_URL + default: + baseURL = IOS_APP_CLIP_BASE_URL } - services, err := validateInputServices(input) + base64Data := base64.StdEncoding.EncodeToString([]byte(data)) + parsedURL, err := url.Parse(baseURL) if err != nil { - return nil, err + return "", fmt.Errorf("error parsing base URL: %w", err) } - return services, nil -} -func encodeComponents(servicesJSON []byte, publicKey string, redirectURL string) string { - encodedServices := url.QueryEscape(string(servicesJSON)) - encodedRedirectURL := url.QueryEscape(redirectURL) - encodedPublicKey := url.QueryEscape(publicKey) + query := parsedURL.Query() + query.Set("publicKey", publicKey) + query.Set("redirectUrl", redirectUrl) + query.Set("data", base64Data) - return fmt.Sprintf("%s&services=%s&redirectUrl=%s&publicKey=%s", APP_CLIP_BASE_URL, encodedServices, encodedRedirectURL, encodedPublicKey) + parsedURL.RawQuery = query.Encode() + + return parsedURL.String(), nil } -func servicesToJSON(services map[string]Service) []byte { - var servicesSlice []Service - for _, service := range services { - servicesSlice = append(servicesSlice, service) - } - - servicesJSON, err := json.Marshal(servicesSlice) +func servicesToJSON(services InputData) []byte { + servicesJSON, err := json.Marshal(services) if err != nil { log.Fatalf("Error marshaling JSON: %v", err) } diff --git a/connect/connect_test.go b/connect/connect_test.go new file mode 100644 index 0000000..5b666a4 --- /dev/null +++ b/connect/connect_test.go @@ -0,0 +1 @@ +package connect \ No newline at end of file diff --git a/connect/example/main.go b/connect/example/main.go index d88b343..a7de1c2 100644 --- a/connect/example/main.go +++ b/connect/example/main.go @@ -12,25 +12,31 @@ const redirectURL = "https://example.com" func main() { - qrCodeServices := connect.Services{ - {Name: "Netflix", Status: true}, - {Name: "Playstation", Status: false}, + services := connect.InputData{ + "netflix": connect.Service{ + Traits: []string{"rating"}, + Activities: []string{"watch"}, + }, } - qrCodeURL, err := connect.GenerateQRCode(publicKey, redirectURL, qrCodeServices) + + conn, err := connect.NewConnect(publicKey, redirectURL, connect.PlatformTypeIOS, services) if err != nil { - log.Fatalf("An error occurred generating QR Code url: %v", err) + log.Fatalf("An error occurred with initializing connect: %v", err) } - fmt.Println("QR Code URL => ", qrCodeURL) - services := connect.Services{ - {Name: "Netflix", Status: false}, - {Name: "Playstation", Status: true}, + url, err := conn.GenerateURL() + if err != nil { + log.Fatalf("An error occurred generating url: %v", err) } - url, err := connect.GenerateURL(publicKey, redirectURL, services) + fmt.Println("URL => ", url) + + + qrCodeURL, err := conn.GenerateQRCode(services) if err != nil { - log.Fatalf("An error occurred url: %v", err) + log.Fatalf("An error occurred generating QR Code url: %v", err) } + fmt.Println("QR Code URL => ", qrCodeURL) + - fmt.Println("URL => ", url) } \ No newline at end of file diff --git a/connect/filename.json b/connect/filename.json deleted file mode 100644 index df90e5e..0000000 --- a/connect/filename.json +++ /dev/null @@ -1 +0,0 @@ -{"__schema":{"types":[{"kind":"OBJECT","name":"Activity","description":"","fields":[{"name":"id","description":"Unique identifier for the activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"metadata","description":"Metadata associated with the activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[{"kind":"OBJECT","name":"NetflixActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"PlaystationActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"AmazonActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"YoutubeActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"UberActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},{"kind":"OBJECT","name":"InstacartActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"ofType":null},{"kind":"OBJECT","name":"ActivityResponse","description":"","fields":[{"name":"data","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Activity","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"limit","description":"The maximum number of activities to retrieve (limit: 300).","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"total","description":"The total number of available activities in the dataset.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"page","description":"The page number from which activities are being pulled.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"AmazonActivityMetadata","description":"","fields":[{"name":"productName","description":"The product name of the Amazon activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating when the activity occurred.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"quantityPurchased","description":"Quantity of item purchased","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"totalCost","description":"Total cost of purchased product","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Application","description":"Represents a registered application within the system, encapsulating all relevant details\nthat identify and describe the application.","fields":[{"name":"appName","description":"The human-readable name of the application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"publicKey","description":"A public key associated with the application, used for cryptographic operations such as\nverifying the identity of the application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"iconURL","description":"The URL pointing to the icon graphic for the application. This URL should link to an image\nthat visually represents the application, aiding in its identification and branding.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"gandalfID","description":"A unique identifier assigned to the application upon registration.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"appRegistrar","description":"The address of the user who registered the application. ","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Boolean","description":"The `Boolean` scalar type represents `true` or `false`.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"ContentType","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"VIDEO","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SHORTS","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MUSIC","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Date","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Float","description":"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"ID","description":"The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as \"4\") or integer (such as 4) input value will be accepted as an ID.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Identifier","description":"","fields":[{"name":"value","description":"The string value of the identifier.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"identifierType","description":"The type of the identifier (enumeration)","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"IdentifierType","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"IdentifierType","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"IMDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MOBY","description":"","isDeprecated":false,"deprecationReason":""},{"name":"RAWG","description":"","isDeprecated":false,"deprecationReason":""},{"name":"IGDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ASIN","description":"","isDeprecated":false,"deprecationReason":""},{"name":"PLAYSTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"YOUTUBE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TVDB","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TVMAZE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UBER","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INSTACART","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"InstacartActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"retailer","description":"The name of the ratailer that handled the order.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"totalOrderAmountSpent","description":"The total amount spent on this order.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dateOrdered","description":"The date the order was placed","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dateDelivered","description":"The date the order was delivered","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"statusString","description":"String indicating the status of the order","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"items","description":"List of items ordered.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"InstacartOrderItem","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"InstacartItemStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"FOUND","description":"","isDeprecated":false,"deprecationReason":""},{"name":"REPLACED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"TOREFUND","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"InstacartOrderItem","description":"","fields":[{"name":"itemID","description":"The Instacart ID of the item","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"productName","description":"The name of the ordered item.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"unitPrice","description":"The price per unit e.g (1.39 • 1 gal).","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"status","description":"Enum indicating the status of the ordered item e.g found","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"InstacartItemStatus","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"quantityPurchased","description":"The quantity purchased.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"InstacartOrderStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"COMPLETE","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Int","description":"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Int64","description":"Scalar type representing a 64-bit signed integer.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"JSON","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Map","description":"Scalar type representing a map data structure.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"NetflixActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Netflix activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating when the activity occurred , formatted as (DD/MM/YYYY).","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":true,"deprecationReason":"use lastPlayedAt","args":[]},{"name":"lastPlayedAt","description":"Date indicating when the activity was last played , formatted as (DD/MM/YYYY).","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"PlaystationActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Playstation activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"lastPlayedAt","description":"Date indicating the last time game was played.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"Query","description":"","fields":[{"name":"getActivity","description":"Retrieves a paginated list of activities based on a given data key and source.\n\nReturns: A response object containing a list of activities, along with pagination information.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"ActivityResponse","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"dataKey","description":"A unique key that is generated after a user has completed the data submission flow.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"source","description":"A unique key that is generated after a user has completed the data submission flow.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"Source","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"limit","description":"The maximum number of activities to return in a single response.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"page","description":"The page number of the activity list to retrieve, allowing for pagination through large sets of data.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int64","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"lookupActivity","description":"Looks up a specific activity by its unique identifier (ID) and a data key.\n\nReturns: An Activity object containing detailed information about the requested activity.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Activity","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"dataKey","description":"A unique key that is generated after a user has completed the data submission flow. ","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null},{"name":"activityId","description":"The unique identifier (UUID) of the activity to retrieve.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"UUID","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"getAppByPublicKey","description":"Retrieves an application by its public key.\n\nReturns: An Application object that includes detailed information about the requested application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Application","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"publicKey","description":"The public key associated with the desired application.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":null}]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"Source","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"NETFLIX","description":"","isDeprecated":false,"deprecationReason":""},{"name":"PLAYSTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"YOUTUBE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"AMAZON","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UBER","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INSTACART","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"String","description":"The `String`scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"Time","description":"Scalar type representing a specific point in time.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"TripStatus","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"CANCELED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"COMPLETED","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNFULFILLED","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"SCALAR","name":"UUID","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"UberActivityMetadata","description":"","fields":[{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"beginTripTime","description":"This indicates the start time of the trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Time","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"dropoffTime","description":"This indicates the end time of the trip","type":{"kind":"SCALAR","name":"Time","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"cost","description":"A string indicating the cost of the trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"city","description":"A string indicating the city the trip originated from","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"distance","description":"Distance covered from pickup to dropoff location","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"status","description":"Enum indicating the status of a trip","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"TripStatus","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"YoutubeActivityMetadata","description":"","fields":[{"name":"title","description":"The title of the Youtube activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subject","description":"List of identifiers associated with the activity's subject.","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"Identifier","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"date","description":"Date indicating the last time the Youtube video was played.","type":{"kind":"SCALAR","name":"Date","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"percentageWatched","description":"An integer indicating what percentage of the entire video duration watched.","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Int","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"contentType","description":"Enum denoting the type of the youtube activity","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"ContentType","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"ActivityMetadata","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Directive","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"locations","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"args","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isRepeatable","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"__DirectiveLocation","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"QUERY","description":"","isDeprecated":false,"deprecationReason":""},{"name":"MUTATION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SUBSCRIPTION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FIELD","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FRAGMENT_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FRAGMENT_SPREAD","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INLINE_FRAGMENT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"VARIABLE_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SCHEMA","description":"","isDeprecated":false,"deprecationReason":""},{"name":"SCALAR","description":"","isDeprecated":false,"deprecationReason":""},{"name":"OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"FIELD_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ARGUMENT_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INTERFACE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM_VALUE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_FIELD_DEFINITION","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__EnumValue","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isDeprecated","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"deprecationReason","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Field","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"args","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"type","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"isDeprecated","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"deprecationReason","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__InputValue","description":"","fields":[{"name":"name","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"type","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"defaultValue","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Schema","description":"","fields":[{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"types","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"queryType","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"mutationType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"subscriptionType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"directives","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Directive","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"OBJECT","name":"__Type","description":"","fields":[{"name":"kind","description":"","type":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"ENUM","name":"__TypeKind","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"name","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"description","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"fields","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Field","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"includeDeprecated","description":"","type":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"false","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"interfaces","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"possibleTypes","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"enumValues","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[{"name":"includeDeprecated","description":"","type":{"kind":"SCALAR","name":"Boolean","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"false","isDeprecated":false,"deprecationReason":"","args":null}]},{"name":"inputFields","description":"","type":{"kind":"LIST","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"NON_NULL","name":"","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":{"kind":"OBJECT","name":"__InputValue","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null}}},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"ofType","description":"","type":{"kind":"OBJECT","name":"__Type","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]},{"name":"specifiedByURL","description":"","type":{"kind":"SCALAR","name":"String","description":"","fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null,"ofType":null},"defaultValue":"","isDeprecated":false,"deprecationReason":"","args":[]}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[],"ofType":null},{"kind":"ENUM","name":"__TypeKind","description":"","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"SCALAR","description":"","isDeprecated":false,"deprecationReason":""},{"name":"OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INTERFACE","description":"","isDeprecated":false,"deprecationReason":""},{"name":"UNION","description":"","isDeprecated":false,"deprecationReason":""},{"name":"ENUM","description":"","isDeprecated":false,"deprecationReason":""},{"name":"INPUT_OBJECT","description":"","isDeprecated":false,"deprecationReason":""},{"name":"LIST","description":"","isDeprecated":false,"deprecationReason":""},{"name":"NON_NULL","description":"","isDeprecated":false,"deprecationReason":""}],"possibleTypes":[],"ofType":null}]}} \ No newline at end of file diff --git a/connect/types.go b/connect/types.go index 696aa6f..c59f43b 100644 --- a/connect/types.go +++ b/connect/types.go @@ -1,5 +1,12 @@ package connect +type PlatformType string + +const ( + PlatformTypeIOS PlatformType = "ios" + PlatformTypeAndroid PlatformType = "android" + PlatformUniversal PlatformType = "universal" +) type GandalfErrorCode int @@ -32,14 +39,14 @@ type SupportedService struct { DeprecationReason string `json:"deprecationReason"` } -type SupportedServices []Value - type Service struct { - Name string - Status bool + Traits []string `json:"traits,omitempty"` + Activities []string `json:"activities,omitempty"` } -type Services []Service +type InputData map[string]interface{} + +type SupportedServices []Value // Type represents a GraphQL type with various properties like kind, name, description, etc. type Type struct { @@ -79,97 +86,3 @@ type IntrospectionResult struct { Types []Type `json:"types"` } `json:"__schema"` } - -const introspectionQuery = ` - query { - __schema { - types { - kind - name - description - fields(includeDeprecated: true) { - name - description - args { - name - description - type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - defaultValue - } - type { - kind - name - ofType { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - } - isDeprecated - deprecationReason - } - inputFields { - name - description - type { - kind - name - ofType { - kind - name - ofType { - kind - name - } - } - } - defaultValue - } - interfaces { - kind - name - ofType { - kind - name - } - } - enumValues(includeDeprecated: true) { - name - description - isDeprecated - deprecationReason - } - possibleTypes { - kind - name - ofType { - kind - name - } - } - } - } - } -` \ No newline at end of file diff --git a/eyeofsauron/constants.go b/eyeofsauron/constants/constants.go similarity index 95% rename from eyeofsauron/constants.go rename to eyeofsauron/constants/constants.go index 6bbc920..d4ec078 100644 --- a/eyeofsauron/constants.go +++ b/eyeofsauron/constants/constants.go @@ -1,6 +1,6 @@ -package main +package constants -const gqlgenConfig = ` +const GQLGenConfig = ` schema: schema.graphql operations: - genqlient.graphql @@ -16,7 +16,7 @@ bindings: type: time.Time ` -const introspectionQuery = ` +const IntrospectionQuery = ` query { __schema { types { diff --git a/eyeofsauron/main.go b/eyeofsauron/main.go index 1507897..4e9f909 100644 --- a/eyeofsauron/main.go +++ b/eyeofsauron/main.go @@ -10,6 +10,7 @@ import ( "strings" graphqlClient "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphql" + "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/constants" "github.com/gandalf-network/genqlient/generate" ) @@ -74,7 +75,7 @@ func main() { folder = filepath.Join(cwd, folder) client := graphqlClient.NewClient("https://sauron.gandalf.network/public/gql") - req := graphqlClient.NewRequest(introspectionQuery) + req := graphqlClient.NewRequest(constants.IntrospectionQuery) ctx := context.Background() @@ -98,7 +99,7 @@ func main() { writeToFile(filepath.Join(folder, "genqlient.graphql"), stringBuilder.String()) var gqlgenConfigFilename = filepath.Join(folder, "genqlient.yaml") - writeToFile(gqlgenConfigFilename, gqlgenConfig) + writeToFile(gqlgenConfigFilename, constants.GQLGenConfig) var config *generate.Config diff --git a/go.mod b/go.mod index 656b70a..491c794 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.22.1 require ( github.com/btcsuite/btcd/btcec/v2 v2.3.3 - github.com/davecgh/go-spew v1.1.1 github.com/gandalf-network/genqlient v1.0.2 github.com/google/uuid v1.6.0 + github.com/joho/godotenv v1.5.1 github.com/pkg/errors v0.9.1 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e ) diff --git a/go.sum b/go.sum index 03639e9..3f88831 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,8 @@ github.com/gandalf-network/genqlient v1.0.2 h1:ahF1C/q7On09W2So8tD9oye4HB4sD3M3b github.com/gandalf-network/genqlient v1.0.2/go.mod h1:psNwR/HdMPm9ELCr4ApfcUj4+cenzDbZkPBUl6JYEi0= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From 5a8ff9fc32d8f0e15c872a589278d42b1a6f0b0a Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Fri, 7 Jun 2024 11:54:54 +0000 Subject: [PATCH 04/14] Update example code Signed-off-by: Bashorun97 --- .gitignore | 3 ++- connect/connect.go | 43 ++++++++++++++--------------------------- connect/example/main.go | 31 ++++++++++++++++++++++++++--- connect/types.go | 16 +++++++++++++++ go.mod | 1 - go.sum | 2 -- 6 files changed, 60 insertions(+), 36 deletions(-) diff --git a/.gitignore b/.gitignore index f83461b..76d29a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .gitpod.yaml -.env \ No newline at end of file +.env +decoded_qrcode.png \ No newline at end of file diff --git a/connect/connect.go b/connect/connect.go index 94dc9b3..589093e 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -17,9 +17,9 @@ import ( var ( IOS_APP_CLIP_BASE_URL = "https://appclip.apple.com/id?p=network.gandalf.connect.Clip" - ANDROID_APP_CLIP_BASE_URL = os.Getenv("ANDROID_APP_CLIP_BASE_URL") + ANDROID_APP_CLIP_BASE_URL = os.Getenv("ANDROID_APP_CLIP_BASE_URL") UNIVERSAL_APP_CLIP_BASE_URL = os.Getenv("UNIVERSAL_APP_CLIP_BASE_URL") - SAURON_BASE_URL = os.Getenv("SAURON_BASE_URL") + SAURON_BASE_URL = "https://sauron.gandalf.network/public/gql" ) @@ -38,23 +38,15 @@ func (e *GandalfError) Error() string { } -type Connect struct { - PublicKey string - RedirectURL string - Platform PlatformType - VerificationStatus bool - Data InputData -} - -func NewConnect(publicKey string, redirectURL string, platform PlatformType, data InputData) (*Connect, error) { - if publicKey == "" || redirectURL == "" { +func NewConnect(config Config) (*Connect, error) { + if config.PublicKey == "" || config.RedirectURL == "" { return nil, fmt.Errorf("invalid parameters") } - if platform == "" { - platform = PlatformTypeIOS + if config.Platform == "" { + config.Platform = PlatformTypeIOS } - return &Connect{PublicKey: publicKey, RedirectURL: redirectURL, Data: data}, nil + return &Connect{PublicKey: config.PublicKey, RedirectURL: config.RedirectURL, Data: config.Data, Platform: config.Platform}, nil } func (c *Connect) GenerateURL() (string, error) { @@ -75,15 +67,15 @@ func (c *Connect) GenerateURL() (string, error) { return url, nil } -func (c *Connect) GenerateQRCode(input InputData) (string, error) { - if input == nil { +func (c *Connect) GenerateQRCode() (string, error) { + if c.Data == nil { return "", &GandalfError{ Message: "Invalid input parameters", Code: QRCodeGenNotSupported, } } - services, err := runValidation(c.PublicKey, c.RedirectURL, input, c.VerificationStatus) + services, err := runValidation(c.PublicKey, c.RedirectURL, c.Data, c.VerificationStatus) if err != nil { return "", err } @@ -310,19 +302,12 @@ func (c *Connect) encodeComponents(data, redirectUrl string, publicKey string) ( } base64Data := base64.StdEncoding.EncodeToString([]byte(data)) - parsedURL, err := url.Parse(baseURL) - if err != nil { - return "", fmt.Errorf("error parsing base URL: %w", err) - } - query := parsedURL.Query() - query.Set("publicKey", publicKey) - query.Set("redirectUrl", redirectUrl) - query.Set("data", base64Data) + encodedServices := url.QueryEscape(string(base64Data)) + encodedRedirectURL := url.QueryEscape(redirectUrl) + encodedPublicKey := url.QueryEscape(publicKey) - parsedURL.RawQuery = query.Encode() - - return parsedURL.String(), nil + return fmt.Sprintf("%s&services=%s&redirectUrl=%s&publicKey=%s", baseURL, encodedServices, encodedRedirectURL, encodedPublicKey), nil } func servicesToJSON(services InputData) []byte { diff --git a/connect/example/main.go b/connect/example/main.go index a7de1c2..8205690 100644 --- a/connect/example/main.go +++ b/connect/example/main.go @@ -1,10 +1,13 @@ package main import ( + "os" "fmt" "log" + "encoding/base64" "github.com/gandalf-network/gandalf-sdk-go/connect" + "strings" ) const publicKey = "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08"; @@ -18,8 +21,14 @@ func main() { Activities: []string{"watch"}, }, } + + config := connect.Config{ + PublicKey: publicKey, + RedirectURL: redirectURL, + Data: services, + } - conn, err := connect.NewConnect(publicKey, redirectURL, connect.PlatformTypeIOS, services) + conn, err := connect.NewConnect(config) if err != nil { log.Fatalf("An error occurred with initializing connect: %v", err) } @@ -32,11 +41,27 @@ func main() { fmt.Println("URL => ", url) - qrCodeURL, err := conn.GenerateQRCode(services) + qrCode, err := conn.GenerateQRCode() if err != nil { log.Fatalf("An error occurred generating QR Code url: %v", err) } - fmt.Println("QR Code URL => ", qrCodeURL) + fmt.Println("Base64 QR Code => ", qrCode) + var base64QRCodeWithPrefix string + if strings.HasPrefix(qrCode, "data:image/png;base64,") { + base64QRCodeWithPrefix = strings.TrimPrefix(qrCode, "data:image/png;base64,") + } + + decodedQRCode, err := base64.StdEncoding.DecodeString(base64QRCodeWithPrefix) + if err != nil { + log.Fatalf("Failed to decode base64 QR code: %v", err) + } + + outputFile := "decoded_qrcode.png" + err = os.WriteFile(outputFile, decodedQRCode, 0644) + if err != nil { + log.Fatalf("Failed to save decoded QR code as PNG: %v", err) + } + fmt.Printf("Decoded QR code saved to %s\n", outputFile) } \ No newline at end of file diff --git a/connect/types.go b/connect/types.go index c59f43b..a3c997f 100644 --- a/connect/types.go +++ b/connect/types.go @@ -1,5 +1,21 @@ package connect + +type Connect struct { + PublicKey string + RedirectURL string + Platform PlatformType + VerificationStatus bool + Data InputData +} + +type Config struct { + PublicKey string + RedirectURL string + Platform PlatformType + Data InputData +} + type PlatformType string const ( diff --git a/go.mod b/go.mod index 491c794..4940ada 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.3 github.com/gandalf-network/genqlient v1.0.2 github.com/google/uuid v1.6.0 - github.com/joho/godotenv v1.5.1 github.com/pkg/errors v0.9.1 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e ) diff --git a/go.sum b/go.sum index 3f88831..03639e9 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,6 @@ github.com/gandalf-network/genqlient v1.0.2 h1:ahF1C/q7On09W2So8tD9oye4HB4sD3M3b github.com/gandalf-network/genqlient v1.0.2/go.mod h1:psNwR/HdMPm9ELCr4ApfcUj4+cenzDbZkPBUl6JYEi0= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= -github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= From ea998945bbebcf3fde7359d8b7bea015c3e384ce Mon Sep 17 00:00:00 2001 From: Bash Date: Mon, 10 Jun 2024 11:56:16 +0100 Subject: [PATCH 05/14] Update connect.go --- connect/connect.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connect/connect.go b/connect/connect.go index 589093e..36069e5 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -307,7 +307,7 @@ func (c *Connect) encodeComponents(data, redirectUrl string, publicKey string) ( encodedRedirectURL := url.QueryEscape(redirectUrl) encodedPublicKey := url.QueryEscape(publicKey) - return fmt.Sprintf("%s&services=%s&redirectUrl=%s&publicKey=%s", baseURL, encodedServices, encodedRedirectURL, encodedPublicKey), nil + return fmt.Sprintf("%s&data=%s&redirectUrl=%s&publicKey=%s", baseURL, encodedServices, encodedRedirectURL, encodedPublicKey), nil } func servicesToJSON(services InputData) []byte { @@ -316,4 +316,4 @@ func servicesToJSON(services InputData) []byte { log.Fatalf("Error marshaling JSON: %v", err) } return servicesJSON -} \ No newline at end of file +} From 0f224dc49f51f649ef3a34a9982490af0be3b4b9 Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Tue, 11 Jun 2024 08:45:55 +0000 Subject: [PATCH 06/14] Connect tests and docs Signed-off-by: Bashorun97 --- README.md | 46 +++++++++++++- connect/connect.go | 8 +-- connect/connect_test.go | 137 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 185 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b3c698e..d907479 100644 --- a/README.md +++ b/README.md @@ -186,4 +186,48 @@ func printJSON(v interface{}) { ## Connect -`Connect` is a library in Go that makes it easier to generate valid Connect URLs that let your users link their accounts to Gandalf. To use this library, follow the installation and usage instructions provided in the documentation. \ No newline at end of file +`Connect` is a library in Go that makes it easier to generate valid Connect URLs that let your users link their accounts to Gandalf. To use this library, follow the installation and usage instructions provided in the documentation. + +```go +const publicKey = "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08"; +const redirectURL = "https://example.com" + + +func main() { + // Define the input data + services := connect.InputData{ + "netflix": connect.Service{ + Traits: []string{"rating"}, + Activities: []string{"watch"}, + }, + } + + // Define the config parameters + config := connect.Config{ + PublicKey: publicKey, + RedirectURL: redirectURL, + Data: services, + } + + // Initialization + conn, err := connect.NewConnect(config) + if err != nil { + log.Fatalf("An error occurred with initializing connect: %v", err) + } + + // Call the GenerateURL method + url, err := conn.GenerateURL() + if err != nil { + log.Fatalf("An error occurred generating url: %v", err) + } + fmt.Println("URL => ", url) + + + // Call the GenerateQRCode method + qrCode, err := conn.GenerateQRCode() + if err != nil { + log.Fatalf("An error occurred generating QR Code url: %v", err) + } + fmt.Println("Base64 QR Code => ", qrCode) +} +``` \ No newline at end of file diff --git a/connect/connect.go b/connect/connect.go index 36069e5..30f258a 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -22,8 +22,6 @@ var ( SAURON_BASE_URL = "https://sauron.gandalf.network/public/gql" ) - - const ( InvalidService GandalfErrorCode = iota InvalidPublicKey @@ -244,12 +242,14 @@ func publicKeyRequest(publicKey string) bool { var graphqlResponse map[string]interface{} if err := client.Run(ctx, graphqlRequest, &graphqlResponse); err != nil { - log.Fatalf("Error making publicKey request query: %v", err) + log.Printf("Error making publicKey request query: %v", err) + return false } responseData, ok := graphqlResponse["getAppByPublicKey"].(map[string]interface{}) if !ok { - log.Fatalf("Unexpected response structure: %v", graphqlResponse) + log.Printf("Unexpected response structure: %v", graphqlResponse) + return false } body, err := json.Marshal(responseData) diff --git a/connect/connect_test.go b/connect/connect_test.go index 5b666a4..3d97b4c 100644 --- a/connect/connect_test.go +++ b/connect/connect_test.go @@ -1 +1,136 @@ -package connect \ No newline at end of file +package connect + +import ( + "testing" +) + +func TestGenerateURL(t *testing.T) { + tests := []struct { + name string + config Config + expectedErr error + validPublicKey bool + }{ + { + name: "Valid parameters", + config: Config{ + PublicKey: "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08", + RedirectURL: "https://example.com/redirect", + Data: InputData{ + "uber": Service{ + Traits: []string{"rating"}, + Activities: []string{"trip"}, + }, + }, + Platform: PlatformTypeIOS, + }, + expectedErr: nil, + validPublicKey: true, + }, + { + name: "Invalid public key", + config: Config{ + PublicKey: "invalid-public-key", + RedirectURL: "https://example.com/redirect", + Data: InputData{ + "uber": Service{ + Traits: []string{"rating"}, + Activities: []string{"trip"}, + }, + }, + Platform: PlatformTypeIOS, + }, + expectedErr: &GandalfError{Message: "Invalid public key", Code: InvalidPublicKey}, + validPublicKey: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + conn, err := NewConnect(tt.config) + if err != nil { + t.Fatalf("NewConnect() error = %v", err) + } + + url, err := conn.GenerateURL() + if tt.expectedErr != nil { + if err == nil || err.Error() != tt.expectedErr.Error() { + t.Fatalf("GenerateURL() error = %v, expectedErr = %v", err, tt.expectedErr) + } + return + } + if err != nil { + t.Fatalf("GenerateURL() error = %v, expectedErr = %v", err, tt.expectedErr) + } + if url == "" { + t.Fatal("GenerateURL() returned an empty URL") + } + }) + } +} + +func TestGenerateQRCode(t *testing.T) { + tests := []struct { + name string + config Config + expectedErr error + validPublicKey bool + }{ + { + name: "Valid parameters", + config: Config{ + PublicKey: "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08", + RedirectURL: "https://example.com/redirect", + Data: InputData{ + "uber": Service{ + Traits: []string{"rating"}, + Activities: []string{"trip"}, + }, + }, + Platform: PlatformTypeIOS, + }, + expectedErr: nil, + validPublicKey: true, + }, + { + name: "Invalid public key", + config: Config{ + PublicKey: "invalid-public-key", + RedirectURL: "https://example.com/redirect", + Data: InputData{ + "uber": Service{ + Traits: []string{"rating"}, + Activities: []string{"trip"}, + }, + }, + Platform: PlatformTypeIOS, + }, + expectedErr: &GandalfError{Message: "Invalid public key", Code: InvalidPublicKey}, + validPublicKey: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + conn, err := NewConnect(tt.config) + if err != nil { + t.Fatalf("NewConnect() error = %v", err) + } + + qrCode, err := conn.GenerateQRCode() + if tt.expectedErr != nil { + if err == nil || err.Error() != tt.expectedErr.Error() { + t.Fatalf("GenerateQRCode() error = %v, expectedErr = %v", err, tt.expectedErr) + } + return + } + if err != nil { + t.Fatalf("GenerateQRCode() error = %v, expectedErr = %v", err, tt.expectedErr) + } + if qrCode == "" { + t.Fatal("GenerateQRCode() returned an empty QR code URL") + } + }) + } +} From af0cb785536dbc972ee4d543817c57381bf4888a Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 12:37:03 +0000 Subject: [PATCH 07/14] Update readme Signed-off-by: Bashorun97 --- .gitpod.yml | 11 -- README.md | 38 +++++ connect/connect.go | 7 +- connect/example/main.go | 29 ++++ example/generated/genqlient.graphql | 218 ++++++++++++++++++++++++ example/generated/genqlient.yaml | 14 ++ example/generated/schema.graphql | 247 ++++++++++++++++++++++++++++ 7 files changed, 549 insertions(+), 15 deletions(-) delete mode 100644 .gitpod.yml create mode 100644 example/generated/genqlient.graphql create mode 100644 example/generated/genqlient.yaml create mode 100644 example/generated/schema.graphql diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 29c34fc..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,11 +0,0 @@ -# This configuration file was automatically generated by Gitpod. -# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) -# and commit this file to your remote git repository to share the goodness with others. - -# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart - -tasks: - - init: go get && go build ./... && go test ./... - command: go run . - - diff --git a/README.md b/README.md index d907479..95e4e18 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,15 @@ func printJSON(v interface{}) { `Connect` is a library in Go that makes it easier to generate valid Connect URLs that let your users link their accounts to Gandalf. To use this library, follow the installation and usage instructions provided in the documentation. + +### Connect installation + +To install the `Connect` package, use the following command: + +```bash +go get github.com/gandalf-network/gandalf-sdk-go/connect +``` + ```go const publicKey = "0x036518f1c7a10fc77f835becc0aca9916c54505f771c82d87dd5943bb01ba5ca08"; const redirectURL = "https://example.com" @@ -230,4 +239,33 @@ func main() { } fmt.Println("Base64 QR Code => ", qrCode) } +``` + +#### Generate URL for Android +```go +func main() { + // Define the input data + services := connect.InputData{ + "netflix": connect.Service{ + Traits: []string{"rating"}, + Activities: []string{"watch"}, + }, + } + + // Define the config parameters + config := connect.Config{ + PublicKey: publicKey, + RedirectURL: redirectURL, + Data: services, + Platform: PlatformTypeAndroid, + } + + // Call the GenerateURL method for Android + androidUrl, err := conn.GenerateURL() + if err != nil { + log.Fatalf("An error occurred generating url: %v", err) + } + fmt.Println("URL => ", androidUrl) +} + ``` \ No newline at end of file diff --git a/connect/connect.go b/connect/connect.go index 30f258a..1b09cf5 100644 --- a/connect/connect.go +++ b/connect/connect.go @@ -7,7 +7,6 @@ import ( "fmt" "log" "net/url" - "os" "strings" "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/constants" @@ -17,8 +16,8 @@ import ( var ( IOS_APP_CLIP_BASE_URL = "https://appclip.apple.com/id?p=network.gandalf.connect.Clip" - ANDROID_APP_CLIP_BASE_URL = os.Getenv("ANDROID_APP_CLIP_BASE_URL") - UNIVERSAL_APP_CLIP_BASE_URL = os.Getenv("UNIVERSAL_APP_CLIP_BASE_URL") + ANDROID_APP_CLIP_BASE_URL = "https://auth.gandalf.network" + UNIVERSAL_APP_CLIP_BASE_URL = "https://auth.gandalf.network" SAURON_BASE_URL = "https://sauron.gandalf.network/public/gql" ) @@ -307,7 +306,7 @@ func (c *Connect) encodeComponents(data, redirectUrl string, publicKey string) ( encodedRedirectURL := url.QueryEscape(redirectUrl) encodedPublicKey := url.QueryEscape(publicKey) - return fmt.Sprintf("%s&data=%s&redirectUrl=%s&publicKey=%s", baseURL, encodedServices, encodedRedirectURL, encodedPublicKey), nil + return fmt.Sprintf("%s?data=%s&redirectUrl=%s&publicKey=%s", baseURL, encodedServices, encodedRedirectURL, encodedPublicKey), nil } func servicesToJSON(services InputData) []byte { diff --git a/connect/example/main.go b/connect/example/main.go index 8205690..83d1b30 100644 --- a/connect/example/main.go +++ b/connect/example/main.go @@ -64,4 +64,33 @@ func main() { } fmt.Printf("Decoded QR code saved to %s\n", outputFile) + + + // Define the input data + servicess := connect.InputData{ + "netflix": connect.Service{ + Traits: []string{"rating"}, + Activities: []string{"watch"}, + }, + } + + // Define the config parameters + configg := connect.Config{ + PublicKey: publicKey, + RedirectURL: redirectURL, + Data: servicess, + Platform: connect.PlatformTypeAndroid, + } + + conn, err = connect.NewConnect(configg) + if err != nil { + log.Fatalf("An error occurred with initializing connect: %v", err) + } + + // Call the GenerateURL method for Android + androidUrl, err := conn.GenerateURL() + if err != nil { + log.Fatalf("An error occurred generating url: %v", err) + } + fmt.Println("Android URL => ", androidUrl) } \ No newline at end of file diff --git a/example/generated/genqlient.graphql b/example/generated/genqlient.graphql new file mode 100644 index 0000000..dc408d9 --- /dev/null +++ b/example/generated/genqlient.graphql @@ -0,0 +1,218 @@ +fragment YoutubeActivityMetadata on YoutubeActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + percentageWatched + contentType +} + +fragment AmazonActivityMetadata on AmazonActivityMetadata { + productName + subject { + ... on Identifier { + value + identifierType + } + } + date + quantityPurchased + totalCost +} + +fragment UberActivityMetadata on UberActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + beginTripTime + dropoffTime + cost + city + distance + status +} + +fragment BookingActivityMetadata on BookingActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + bookingID + price + bookings { + ... on BookingItem { + startDateTime + endDateTime + address + depatureLocation + arrivalLocation + layoverLocations { + String + } + activityType + } + } +} + +fragment PlaystationActivityMetadata on PlaystationActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + lastPlayedAt +} + +fragment NetflixActivityMetadata on NetflixActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + lastPlayedAt +} + +fragment UberEatsActivityMetadata on UberEatsActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + date + restaurant + currency + totalPrice + status + items { + ... on UberEatsOrderItem { + name + price + quantityPurchased + customizations { + ... on UberEatsOrderItemCustomizations { + customization + value + quantity + } + } + } + } +} + +fragment InstacartActivityMetadata on InstacartActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + retailer + totalOrderAmountSpent + dateOrdered + dateDelivered + statusString + items { + ... on InstacartOrderItem { + itemID + productName + unitPrice + status + quantityPurchased + } + } +} + +query getActivity($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { + getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { + ... on ActivityResponse { + data { + ... on Activity { + id + metadata { + ...NetflixActivityMetadata + ...PlaystationActivityMetadata + ...AmazonActivityMetadata + ...BookingActivityMetadata + ...YoutubeActivityMetadata + ...UberActivityMetadata + ...InstacartActivityMetadata + ...UberEatsActivityMetadata + } + } + } + limit + total + page + } + } +} + +query lookupActivity($dataKey: String!, $activityId: UUID!) { + lookupActivity(dataKey: $dataKey, activityId: $activityId) { + ... on Activity { + id + metadata { + ...NetflixActivityMetadata + ...PlaystationActivityMetadata + ...AmazonActivityMetadata + ...BookingActivityMetadata + ...YoutubeActivityMetadata + ...UberActivityMetadata + ...InstacartActivityMetadata + ...UberEatsActivityMetadata + } + } + } +} + +query getAppByPublicKey($publicKey: String!) { + getAppByPublicKey(publicKey: $publicKey) { + ... on Application { + appName + publicKey + iconURL + gandalfID + appRegistrar + } + } +} + +query getTraits($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { + getTraits(dataKey: $dataKey, source: $source, labels: $labels) { + ... on Trait { + id + source + label + value + timestamp + } + } +} + +query lookupTrait($dataKey: String!, $traitId: UUID!) { + lookupTrait(dataKey: $dataKey, traitId: $traitId) { + ... on Trait { + id + source + label + value + timestamp + } + } +} + diff --git a/example/generated/genqlient.yaml b/example/generated/genqlient.yaml new file mode 100644 index 0000000..18dc746 --- /dev/null +++ b/example/generated/genqlient.yaml @@ -0,0 +1,14 @@ + +schema: schema.graphql +operations: +- genqlient.graphql +generated: generated.go +bindings: + Int64: + type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Int64 + Date: + type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Date + UUID: + type: github.com/google/uuid.UUID + Time: + type: time.Time diff --git a/example/generated/schema.graphql b/example/generated/schema.graphql new file mode 100644 index 0000000..e99bd5e --- /dev/null +++ b/example/generated/schema.graphql @@ -0,0 +1,247 @@ +type Activity { + id: String! + metadata: ActivityMetadata! +} + +interface ActivityMetadata { + subject: [Identifier] +} + +type ActivityResponse { + data: [Activity]! + limit: Int64! + total: Int64! + page: Int64! +} + +enum ActivityType { + TRIP + STAY + SHOP + PLAY + WATCH +} + +type AmazonActivityMetadata implements ActivityMetadata { + productName: String! + subject: [Identifier] + date: Date + quantityPurchased: Int! + totalCost: String! +} + +type Application { + appName: String! + publicKey: String! + iconURL: String! + gandalfID: Int64! + appRegistrar: String! +} + +type BookingActivityMetadata implements ActivityMetadata { + subject: [Identifier] + bookingID: String! + price: String! + bookings: [BookingItem]! +} + +type BookingItem { + startDateTime: Time! + endDateTime: Time! + address: String! + depatureLocation: String! + arrivalLocation: String! + layoverLocations: [String]! + activityType: ActivityType! +} + +scalar Boolean + +enum ContentType { + VIDEO + SHORTS + MUSIC +} + +scalar Date + +scalar Float + +scalar ID + +type Identifier { + value: String! + identifierType: IdentifierType! +} + +enum IdentifierType { + IMDB + MOBY + RAWG + IGDB + ASIN + PLAYSTATION + YOUTUBE + TVDB + TVMAZE + UBER + BOOKING + INSTACART + UBEREATS +} + +type InstacartActivityMetadata implements ActivityMetadata { + subject: [Identifier] + retailer: String! + totalOrderAmountSpent: String! + dateOrdered: Date! + dateDelivered: Date! + statusString: String! + items: [InstacartOrderItem]! +} + +enum InstacartItemStatus { + FOUND + REPLACED + TOREFUND +} + +type InstacartOrderItem { + itemID: String! + productName: String! + unitPrice: String! + status: InstacartItemStatus! + quantityPurchased: Int64! +} + +enum InstacartOrderStatus { + COMPLETE +} + +scalar Int + +scalar Int64 + +scalar JSON + +scalar Map + +type NetflixActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + date: Date + lastPlayedAt: Date +} + +type PlaystationActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + lastPlayedAt: Date +} + +type Query { + getActivity(dataKey: String!, activityType: [ActivityType], source: Source!, limit: Int64!, page: Int64!): ActivityResponse! + lookupActivity(dataKey: String!, activityId: UUID!): Activity! + getAppByPublicKey(publicKey: String!): Application! + getTraits(dataKey: String!, source: Source!, labels: [TraitLabel]!): [Trait]! + lookupTrait(dataKey: String!, traitId: UUID!): Trait! +} + +enum Source { + NETFLIX + PLAYSTATION + YOUTUBE + AMAZON + UBER + BOOKING + INSTACART + INSTAGRAM + X + UBEREATS + GANDALF +} + +scalar String + +scalar Time + +type Trait { + id: UUID! + source: Source! + label: TraitLabel! + value: String! + timestamp: Time! +} + +enum TraitLabel { + PRIME_SUBSCRIBER + RATING + TRIP_COUNT + ACCOUNT_CREATED_ON + PLAN + GENIUS_LEVEL + FOLLOWER_COUNT + FOLLOWING_COUNT + USERNAME + POST_COUNT + EMAIL + ORDER_COUNT +} + +enum TripStatus { + CANCELED + COMPLETED + UNFULFILLED +} + +scalar UUID + +type UberActivityMetadata implements ActivityMetadata { + subject: [Identifier] + beginTripTime: Time! + dropoffTime: Time + cost: String! + city: String! + distance: String! + status: TripStatus! +} + +type UberEatsActivityMetadata implements ActivityMetadata { + subject: [Identifier] + date: Date + restaurant: String! + currency: String! + totalPrice: Float! + status: UberEatsOrderStatus! + items: [UberEatsOrderItem]! +} + +type UberEatsOrderItem { + name: String! + price: String! + quantityPurchased: Int64! + customizations: [UberEatsOrderItemCustomizations]! +} + +type UberEatsOrderItemCustomizations { + customization: String! + value: String! + quantity: Int64! +} + +enum UberEatsOrderStatus { + SUCCESS + EATER_CANCELLED + RESTAURANT_CANCELLED + RESTAURANT_UNFULFILLED + UNKNOWN +} + +type YoutubeActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + date: Date + percentageWatched: Int! + contentType: ContentType! +} + From 0970f72c2296f8f0c67ebc1d318a4a8c126b4bdb Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 13:50:02 +0000 Subject: [PATCH 08/14] Traits docs Signed-off-by: Bashorun97 --- eyeofsauron/example/generated/generated.go | 88 +++++++------- .../example/generated/genqlient.graphql | 114 +++++++++--------- eyeofsauron/example/main.go | 95 ++++++++++----- eyeofsauron/main.go | 2 +- 4 files changed, 169 insertions(+), 130 deletions(-) diff --git a/eyeofsauron/example/generated/generated.go b/eyeofsauron/example/generated/generated.go index 39335eb..fb61f58 100644 --- a/eyeofsauron/example/generated/generated.go +++ b/eyeofsauron/example/generated/generated.go @@ -997,9 +997,9 @@ func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) Ge return v.UberActivityMetadata.Distance } -// GetUberActivityMetadataStatus returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.UberActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetUberActivityMetadataStatus() TripStatus { - return v.UberActivityMetadata.UberActivityMetadataStatus +// GetStatus returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetStatus() TripStatus { + return v.UberActivityMetadata.Status } func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { @@ -1042,7 +1042,7 @@ type __premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMeta Distance string `json:"distance"` - UberActivityMetadataStatus TripStatus `json:"UberActivityMetadataStatus"` + Status TripStatus `json:"status"` } func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { @@ -1063,7 +1063,7 @@ func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) __ retval.Cost = v.UberActivityMetadata.Cost retval.City = v.UberActivityMetadata.City retval.Distance = v.UberActivityMetadata.Distance - retval.UberActivityMetadataStatus = v.UberActivityMetadata.UberActivityMetadataStatus + retval.Status = v.UberActivityMetadata.Status return &retval, nil } @@ -1103,9 +1103,9 @@ func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata return v.UberEatsActivityMetadata.TotalPrice } -// GetStatus returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.Status +// GetUberEatsActivityMetadataStatus returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus } // GetItems returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. @@ -1151,7 +1151,7 @@ type __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivity TotalPrice float64 `json:"totalPrice"` - Status UberEatsOrderStatus `json:"status"` + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` } @@ -1173,7 +1173,7 @@ func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata retval.Restaurant = v.UberEatsActivityMetadata.Restaurant retval.Currency = v.UberEatsActivityMetadata.Currency retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.Status = v.UberEatsActivityMetadata.Status + retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus retval.Items = v.UberEatsActivityMetadata.Items return &retval, nil } @@ -2186,9 +2186,9 @@ func (v *LookupActivityMetadataUberActivityMetadata) GetDistance() string { return v.UberActivityMetadata.Distance } -// GetUberActivityMetadataStatus returns LookupActivityMetadataUberActivityMetadata.UberActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetUberActivityMetadataStatus() TripStatus { - return v.UberActivityMetadata.UberActivityMetadataStatus +// GetStatus returns LookupActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetStatus() TripStatus { + return v.UberActivityMetadata.Status } func (v *LookupActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { @@ -2231,7 +2231,7 @@ type __premarshalLookupActivityMetadataUberActivityMetadata struct { Distance string `json:"distance"` - UberActivityMetadataStatus TripStatus `json:"UberActivityMetadataStatus"` + Status TripStatus `json:"status"` } func (v *LookupActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { @@ -2252,7 +2252,7 @@ func (v *LookupActivityMetadataUberActivityMetadata) __premarshalJSON() (*__prem retval.Cost = v.UberActivityMetadata.Cost retval.City = v.UberActivityMetadata.City retval.Distance = v.UberActivityMetadata.Distance - retval.UberActivityMetadataStatus = v.UberActivityMetadata.UberActivityMetadataStatus + retval.Status = v.UberActivityMetadata.Status return &retval, nil } @@ -2290,9 +2290,9 @@ func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 return v.UberEatsActivityMetadata.TotalPrice } -// GetStatus returns LookupActivityMetadataUberEatsActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.Status +// GetUberEatsActivityMetadataStatus returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus } // GetItems returns LookupActivityMetadataUberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. @@ -2338,7 +2338,7 @@ type __premarshalLookupActivityMetadataUberEatsActivityMetadata struct { TotalPrice float64 `json:"totalPrice"` - Status UberEatsOrderStatus `json:"status"` + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` } @@ -2360,7 +2360,7 @@ func (v *LookupActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__ retval.Restaurant = v.UberEatsActivityMetadata.Restaurant retval.Currency = v.UberEatsActivityMetadata.Currency retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.Status = v.UberEatsActivityMetadata.Status + retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus retval.Items = v.UberEatsActivityMetadata.Items return &retval, nil } @@ -2593,13 +2593,13 @@ const ( // UberActivityMetadata includes the GraphQL fields of UberActivityMetadata requested by the fragment UberActivityMetadata. type UberActivityMetadata struct { - Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` - BeginTripTime time.Time `json:"beginTripTime"` - DropoffTime time.Time `json:"dropoffTime"` - Cost string `json:"cost"` - City string `json:"city"` - Distance string `json:"distance"` - UberActivityMetadataStatus TripStatus `json:"UberActivityMetadataStatus"` + Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` + BeginTripTime time.Time `json:"beginTripTime"` + DropoffTime time.Time `json:"dropoffTime"` + Cost string `json:"cost"` + City string `json:"city"` + Distance string `json:"distance"` + Status TripStatus `json:"status"` } // GetSubject returns UberActivityMetadata.Subject, and is useful for accessing the field via an interface. @@ -2620,10 +2620,8 @@ func (v *UberActivityMetadata) GetCity() string { return v.City } // GetDistance returns UberActivityMetadata.Distance, and is useful for accessing the field via an interface. func (v *UberActivityMetadata) GetDistance() string { return v.Distance } -// GetUberActivityMetadataStatus returns UberActivityMetadata.UberActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetUberActivityMetadataStatus() TripStatus { - return v.UberActivityMetadataStatus -} +// GetStatus returns UberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetStatus() TripStatus { return v.Status } // UberActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. type UberActivityMetadataSubjectIdentifier struct { @@ -2641,13 +2639,13 @@ func (v *UberActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierTy // UberEatsActivityMetadata includes the GraphQL fields of UberEatsActivityMetadata requested by the fragment UberEatsActivityMetadata. type UberEatsActivityMetadata struct { - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - Restaurant string `json:"restaurant"` - Currency string `json:"currency"` - TotalPrice float64 `json:"totalPrice"` - Status UberEatsOrderStatus `json:"status"` - Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` + Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` + Date graphqlTypes.Date `json:"date"` + Restaurant string `json:"restaurant"` + Currency string `json:"currency"` + TotalPrice float64 `json:"totalPrice"` + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` + Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` } // GetSubject returns UberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. @@ -2667,8 +2665,10 @@ func (v *UberEatsActivityMetadata) GetCurrency() string { return v.Currency } // GetTotalPrice returns UberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. func (v *UberEatsActivityMetadata) GetTotalPrice() float64 { return v.TotalPrice } -// GetStatus returns UberEatsActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetStatus() UberEatsOrderStatus { return v.Status } +// GetUberEatsActivityMetadataStatus returns UberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadataStatus +} // GetItems returns UberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. func (v *UberEatsActivityMetadata) GetItems() []UberEatsActivityMetadataItemsUberEatsOrderItem { @@ -3004,7 +3004,7 @@ fragment UberActivityMetadata on UberActivityMetadata { cost city distance - UberActivityMetadataStatus: status + status } fragment InstacartActivityMetadata on InstacartActivityMetadata { subject { @@ -3039,7 +3039,7 @@ fragment UberEatsActivityMetadata on UberEatsActivityMetadata { restaurant currency totalPrice - status + UberEatsActivityMetadataStatus: status items { ... on UberEatsOrderItem { name @@ -3320,7 +3320,7 @@ fragment UberActivityMetadata on UberActivityMetadata { cost city distance - UberActivityMetadataStatus: status + status } fragment InstacartActivityMetadata on InstacartActivityMetadata { subject { @@ -3355,7 +3355,7 @@ fragment UberEatsActivityMetadata on UberEatsActivityMetadata { restaurant currency totalPrice - status + UberEatsActivityMetadataStatus: status items { ... on UberEatsOrderItem { name diff --git a/eyeofsauron/example/generated/genqlient.graphql b/eyeofsauron/example/generated/genqlient.graphql index 07d33b0..b41d398 100644 --- a/eyeofsauron/example/generated/genqlient.graphql +++ b/eyeofsauron/example/generated/genqlient.graphql @@ -1,4 +1,4 @@ -fragment YoutubeActivityMetadata on YoutubeActivityMetadata { +fragment NetflixActivityMetadata on NetflixActivityMetadata { title: title subject: subject { ... on Identifier { @@ -7,12 +7,11 @@ fragment YoutubeActivityMetadata on YoutubeActivityMetadata { } } date: date - percentageWatched: percentageWatched - contentType: contentType + lastPlayedAt: lastPlayedAt } -fragment NetflixActivityMetadata on NetflixActivityMetadata { - title: title +fragment AmazonActivityMetadata on AmazonActivityMetadata { + productName: productName subject: subject { ... on Identifier { value @@ -20,18 +19,45 @@ fragment NetflixActivityMetadata on NetflixActivityMetadata { } } date: date - lastPlayedAt: lastPlayedAt + quantityPurchased: quantityPurchased + totalCost: totalCost } -fragment PlaystationActivityMetadata on PlaystationActivityMetadata { - title: title +fragment BookingActivityMetadata on BookingActivityMetadata { subject: subject { ... on Identifier { value identifierType } } - lastPlayedAt: lastPlayedAt + bookingID: bookingID + price: price + bookings: bookings { + ... on BookingItem { + startDateTime + endDateTime + address + depatureLocation + arrivalLocation + layoverLocations + activityType + } + } +} + +fragment UberActivityMetadata on UberActivityMetadata { + subject: subject { + ... on Identifier { + value + identifierType + } + } + beginTripTime: beginTripTime + dropoffTime: dropoffTime + cost: cost + city: city + distance: distance + status: status } fragment UberEatsActivityMetadata on UberEatsActivityMetadata { @@ -45,7 +71,7 @@ fragment UberEatsActivityMetadata on UberEatsActivityMetadata { restaurant: restaurant currency: currency totalPrice: totalPrice - status: status + UberEatsActivityMetadataStatus: status items: items { ... on UberEatsOrderItem { name @@ -62,75 +88,49 @@ fragment UberEatsActivityMetadata on UberEatsActivityMetadata { } } -fragment InstacartActivityMetadata on InstacartActivityMetadata { - subject: subject { - ... on Identifier { - value - identifierType - } - } - retailer: retailer - totalOrderAmountSpent: totalOrderAmountSpent - dateOrdered: dateOrdered - dateDelivered: dateDelivered - statusString: statusString - InstacartActivityMetadataItems: items { - ... on InstacartOrderItem { - itemID - productName - unitPrice - status - quantityPurchased - } - } -} - -fragment UberActivityMetadata on UberActivityMetadata { +fragment YoutubeActivityMetadata on YoutubeActivityMetadata { + title: title subject: subject { ... on Identifier { value identifierType } } - beginTripTime: beginTripTime - dropoffTime: dropoffTime - cost: cost - city: city - distance: distance - UberActivityMetadataStatus: status + date: date + percentageWatched: percentageWatched + contentType: contentType } -fragment AmazonActivityMetadata on AmazonActivityMetadata { - productName: productName +fragment PlaystationActivityMetadata on PlaystationActivityMetadata { + title: title subject: subject { ... on Identifier { value identifierType } } - date: date - quantityPurchased: quantityPurchased - totalCost: totalCost + lastPlayedAt: lastPlayedAt } -fragment BookingActivityMetadata on BookingActivityMetadata { +fragment InstacartActivityMetadata on InstacartActivityMetadata { subject: subject { ... on Identifier { value identifierType } } - bookingID: bookingID - price: price - bookings: bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType + retailer: retailer + totalOrderAmountSpent: totalOrderAmountSpent + dateOrdered: dateOrdered + dateDelivered: dateDelivered + statusString: statusString + InstacartActivityMetadataItems: items { + ... on InstacartOrderItem { + itemID + productName + unitPrice + status + quantityPurchased } } } diff --git a/eyeofsauron/example/main.go b/eyeofsauron/example/main.go index ca01c05..30a30b5 100644 --- a/eyeofsauron/example/main.go +++ b/eyeofsauron/example/main.go @@ -1,6 +1,7 @@ package main import ( + "context" "encoding/json" "fmt" @@ -11,37 +12,41 @@ import ( ) func main() { - eye, err := generated.NewEyeOfSauron("0x366a5ae7c7575f8cb0e3832ad53e668061e0ad800b94ffb75fd5b6d241a83e56") - if err != nil { - log.Fatalf("failed to run gandalf client: %s", err) - } + // eye, err := generated.NewEyeOfSauron("0x366a5ae7c7575f8cb0e3832ad53e668061e0ad800b94ffb75fd5b6d241a83e56") + // if err != nil { + // log.Fatalf("failed to run gandalf client: %s", err) + // } - response, err := eye.GetActivity( - context.Background(), - "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", - []generated.ActivityType{generated.ActivityTypePlay}, - generated.SourceNetflix, - 100, - 1, - ) - if err != nil { - log.Fatalf("failed to run gandalf client: %s", err) - } + // response, err := eye.GetActivity( + // context.Background(), + // "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", + // []generated.ActivityType{generated.ActivityTypePlay}, + // generated.SourceNetflix, + // 100, + // 1, + // ) - for _, activity := range response.GetGetActivity().Data { - activityID, _ := uuid.Parse(activity.Id) - response, err := eye.LookupActivity( - context.Background(), - "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", - activityID, - ) - - if err != nil { - log.Fatalf("unable to look up activity: %s", err) - } - printLookupActivityMetadata(response.LookupActivity.GetMetadata()) - } + // if err != nil { + // log.Fatalf("failed to run gandalf client: %s", err) + // } + + // for _, activity := range response.GetGetActivity().Data { + // activityID, _ := uuid.Parse(activity.Id) + // response, err := eye.LookupActivity( + // context.Background(), + // "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", + // activityID, + // ) + + // if err != nil { + // log.Fatalf("unable to look up activity: %s", err) + // } + // printLookupActivityMetadata(response.LookupActivity.GetMetadata()) + // } + + getTrait() + lookupTrait() } func printGetActivityMetadata(metadata interface{}) { @@ -102,3 +107,37 @@ func printJSON(v interface{}) { } fmt.Println(string(jsonData)) } + +func getTrait() { + // Initialization + eye, err := generated.NewEyeOfSauron("8c48ad0e5892d51d8e2e411a77a1d73ebe764b619c846d1cab3dc45ee172e8ca") + if err != nil { + log.Fatalf("failed to run gandalf client: %s", err) + } + + response, err := eye.GetTraits(context.Background(), "3pLT1hCieyPQQb876i24D34Qf8y6Yyke5m4rhPRhV67D", generated.SourceNetflix, []generated.TraitLabel{generated.TraitLabelPlan}) + if err != nil { + log.Fatalf("failed to get traits: %s", err) + } + + fmt.Println("Get Traits", response.GetGetTraits()) +} + +func lookupTrait() { + // Lookup trait + eye, err := generated.NewEyeOfSauron("8c48ad0e5892d51d8e2e411a77a1d73ebe764b619c846d1cab3dc45ee172e8ca") + if err != nil { + log.Fatalf("failed to run gandalf client: %s", err) + } + + traitID, err := uuid.Parse("e55bf3a6-66a5-4902-b7f2-34e352b65d52") + if err != nil { + log.Fatalf("failed to parse string to uuid") + } + response, err := eye.LookupTrait(context.Background(), "3pLT1hCieyPQQb876i24D34Qf8y6Yyke5m4rhPRhV67D", traitID) + if err != nil { + log.Fatalf("failed to get traits: %s", err) + } + + fmt.Println("Lookup Trait", response.GetLookupTrait()) +} \ No newline at end of file diff --git a/eyeofsauron/main.go b/eyeofsauron/main.go index b6a3044..e8bc37d 100644 --- a/eyeofsauron/main.go +++ b/eyeofsauron/main.go @@ -76,7 +76,7 @@ func main() { // Join the CWD with the provided folder path folder = filepath.Join(cwd, folder) - client := graphqlClient.NewClient("https://sauron.gandalf.network/public/gql") + client := graphqlClient.NewClient("https://sauron-staging.gandalf.network/public/gql") req := graphqlClient.NewRequest(constants.IntrospectionQuery) ctx := context.Background() From 071facd87506ef7e08ad02cf8138525dd7b1e20f Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 13:54:32 +0000 Subject: [PATCH 09/14] Android docs Signed-off-by: Bashorun97 --- README.md | 45 +++++++++++++++++++++++++++++++++++++++-- connect/example/main.go | 24 ++++++---------------- 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 95e4e18..a083e81 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ import ( "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/example/generated" ) -func getActivity() { +func main() { // Initialization eye, err := generated.NewEyeOfSauron(" ", url) + // Generate QRCode qrCode, err := conn.GenerateQRCode() if err != nil { log.Fatalf("An error occurred generating QR Code url: %v", err) @@ -66,28 +67,15 @@ func main() { fmt.Printf("Decoded QR code saved to %s\n", outputFile) - // Define the input data - servicess := connect.InputData{ - "netflix": connect.Service{ - Traits: []string{"rating"}, - Activities: []string{"watch"}, - }, - } - - // Define the config parameters - configg := connect.Config{ - PublicKey: publicKey, - RedirectURL: redirectURL, - Data: servicess, - Platform: connect.PlatformTypeAndroid, - } + // Set Android Platform + config.Platform = connect.PlatformTypeAndroid - conn, err = connect.NewConnect(configg) + conn, err = connect.NewConnect(config) if err != nil { log.Fatalf("An error occurred with initializing connect: %v", err) } - // Call the GenerateURL method for Android + // GenerateURL method for Android androidUrl, err := conn.GenerateURL() if err != nil { log.Fatalf("An error occurred generating url: %v", err) From 0f30cb6c717052fb96449900db4019b6bb5cd2a3 Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 14:48:09 +0000 Subject: [PATCH 10/14] Update docs Signed-off-by: Bashorun97 --- eyeofsauron/example/generated/generated.go | 1180 ++------------------ eyeofsauron/example/main.go | 68 +- 2 files changed, 120 insertions(+), 1128 deletions(-) diff --git a/eyeofsauron/example/generated/generated.go b/eyeofsauron/example/generated/generated.go index fb61f58..75e9bd1 100644 --- a/eyeofsauron/example/generated/generated.go +++ b/eyeofsauron/example/generated/generated.go @@ -68,16 +68,6 @@ func SignMessageAsBase64(privKey *ecdsa.PrivateKey, message []byte) (string, err return signatureB64, nil } -type ActivityType string - -const ( - ActivityTypeTrip ActivityType = "TRIP" - ActivityTypeStay ActivityType = "STAY" - ActivityTypeShop ActivityType = "SHOP" - ActivityTypePlay ActivityType = "PLAY" - ActivityTypeWatch ActivityType = "WATCH" -) - // AmazonActivityMetadata includes the GraphQL fields of AmazonActivityMetadata requested by the fragment AmazonActivityMetadata. type AmazonActivityMetadata struct { ProductName string `json:"productName"` @@ -118,86 +108,6 @@ func (v *AmazonActivityMetadataSubjectIdentifier) GetIdentifierType() Identifier return v.IdentifierType } -// BookingActivityMetadata includes the GraphQL fields of BookingActivityMetadata requested by the fragment BookingActivityMetadata. -type BookingActivityMetadata struct { - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` - BookingID string `json:"bookingID"` - Price string `json:"price"` - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` -} - -// GetSubject returns BookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetBookingID returns BookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetBookingID() string { return v.BookingID } - -// GetPrice returns BookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetPrice() string { return v.Price } - -// GetBookings returns BookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.Bookings -} - -// BookingActivityMetadataBookingsBookingItem includes the requested fields of the GraphQL type BookingItem. -type BookingActivityMetadataBookingsBookingItem struct { - StartDateTime time.Time `json:"startDateTime"` - EndDateTime time.Time `json:"endDateTime"` - Address string `json:"address"` - DepatureLocation string `json:"depatureLocation"` - ArrivalLocation string `json:"arrivalLocation"` - LayoverLocations []string `json:"layoverLocations"` - ActivityType ActivityType `json:"activityType"` -} - -// GetStartDateTime returns BookingActivityMetadataBookingsBookingItem.StartDateTime, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetStartDateTime() time.Time { - return v.StartDateTime -} - -// GetEndDateTime returns BookingActivityMetadataBookingsBookingItem.EndDateTime, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetEndDateTime() time.Time { return v.EndDateTime } - -// GetAddress returns BookingActivityMetadataBookingsBookingItem.Address, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetAddress() string { return v.Address } - -// GetDepatureLocation returns BookingActivityMetadataBookingsBookingItem.DepatureLocation, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetDepatureLocation() string { - return v.DepatureLocation -} - -// GetArrivalLocation returns BookingActivityMetadataBookingsBookingItem.ArrivalLocation, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetArrivalLocation() string { - return v.ArrivalLocation -} - -// GetLayoverLocations returns BookingActivityMetadataBookingsBookingItem.LayoverLocations, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetLayoverLocations() []string { - return v.LayoverLocations -} - -// GetActivityType returns BookingActivityMetadataBookingsBookingItem.ActivityType, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetActivityType() ActivityType { - return v.ActivityType -} - -// BookingActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type BookingActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns BookingActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns BookingActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - type ContentType string const ( @@ -312,12 +222,10 @@ func (v *GetActivityActivityResponseDataActivity) __premarshalJSON() (*__premars // // GetActivityActivityResponseDataActivityMetadata is implemented by the following types: // GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata -// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata // GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata // GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata // GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata // GetActivityActivityResponseDataActivityMetadataUberActivityMetadata -// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata // GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata type GetActivityActivityResponseDataActivityMetadata interface { implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() @@ -327,8 +235,6 @@ type GetActivityActivityResponseDataActivityMetadata interface { func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { } -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { } func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { @@ -337,8 +243,6 @@ func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetad } func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { } -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { } @@ -359,9 +263,6 @@ func __unmarshalGetActivityActivityResponseDataActivityMetadata(b []byte, v *Get case "AmazonActivityMetadata": *v = new(GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) return json.Unmarshal(b, *v) - case "BookingActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) - return json.Unmarshal(b, *v) case "InstacartActivityMetadata": *v = new(GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) return json.Unmarshal(b, *v) @@ -374,9 +275,6 @@ func __unmarshalGetActivityActivityResponseDataActivityMetadata(b []byte, v *Get case "UberActivityMetadata": *v = new(GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) return json.Unmarshal(b, *v) - case "UberEatsActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) - return json.Unmarshal(b, *v) case "YoutubeActivityMetadata": *v = new(GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) return json.Unmarshal(b, *v) @@ -405,18 +303,6 @@ func __marshalGetActivityActivityResponseDataActivityMetadata(v *GetActivityActi *__premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata }{typename, premarshaled} return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata: - typename = "BookingActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) case *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata: typename = "InstacartActivityMetadata" @@ -465,18 +351,6 @@ func __marshalGetActivityActivityResponseDataActivityMetadata(v *GetActivityActi *__premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata }{typename, premarshaled} return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata: - typename = "UberEatsActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) case *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata: typename = "YoutubeActivityMetadata" @@ -592,93 +466,6 @@ func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) return &retval, nil } -// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - BookingActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.BookingActivityMetadata.Subject -} - -// GetBookingID returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookingID() string { - return v.BookingActivityMetadata.BookingID -} - -// GetPrice returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetPrice() string { - return v.BookingActivityMetadata.Price -} - -// GetBookings returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.BookingActivityMetadata.Bookings -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.BookingActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` - - BookingID string `json:"bookingID"` - - Price string `json:"price"` - - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.BookingActivityMetadata.Subject - retval.BookingID = v.BookingActivityMetadata.BookingID - retval.Price = v.BookingActivityMetadata.Price - retval.Bookings = v.BookingActivityMetadata.Bookings - return &retval, nil -} - // GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. type GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata struct { Typename string `json:"__typename"` @@ -720,9 +507,9 @@ func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadat return v.InstacartActivityMetadata.StatusString } -// GetInstacartActivityMetadataItems returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.InstacartActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetInstacartActivityMetadataItems() []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem { - return v.InstacartActivityMetadata.InstacartActivityMetadataItems +// GetItems returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.InstacartActivityMetadata.Items } func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { @@ -765,7 +552,7 @@ type __premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivit StatusString string `json:"statusString"` - InstacartActivityMetadataItems []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem `json:"InstacartActivityMetadataItems"` + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` } func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { @@ -786,7 +573,7 @@ func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadat retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered retval.StatusString = v.InstacartActivityMetadata.StatusString - retval.InstacartActivityMetadataItems = v.InstacartActivityMetadata.InstacartActivityMetadataItems + retval.Items = v.InstacartActivityMetadata.Items return &retval, nil } @@ -1067,117 +854,6 @@ func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) __ return &retval, nil } -// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - UberEatsActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.UberEatsActivityMetadata.Subject -} - -// GetDate returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { - return v.UberEatsActivityMetadata.Date -} - -// GetRestaurant returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { - return v.UberEatsActivityMetadata.Restaurant -} - -// GetCurrency returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetCurrency() string { - return v.UberEatsActivityMetadata.Currency -} - -// GetTotalPrice returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { - return v.UberEatsActivityMetadata.TotalPrice -} - -// GetUberEatsActivityMetadataStatus returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus -} - -// GetItems returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetItems() []UberEatsActivityMetadataItemsUberEatsOrderItem { - return v.UberEatsActivityMetadata.Items -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberEatsActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - Restaurant string `json:"restaurant"` - - Currency string `json:"currency"` - - TotalPrice float64 `json:"totalPrice"` - - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - - Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberEatsActivityMetadata.Subject - retval.Date = v.UberEatsActivityMetadata.Date - retval.Restaurant = v.UberEatsActivityMetadata.Restaurant - retval.Currency = v.UberEatsActivityMetadata.Currency - retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus - retval.Items = v.UberEatsActivityMetadata.Items - return &retval, nil -} - // GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. type GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata struct { Typename string `json:"__typename"` @@ -1297,30 +973,6 @@ func (v *GetAppByPublicKeyApplication) GetGandalfID() graphqlTypes.Int64 { retur // GetAppRegistrar returns GetAppByPublicKeyApplication.AppRegistrar, and is useful for accessing the field via an interface. func (v *GetAppByPublicKeyApplication) GetAppRegistrar() string { return v.AppRegistrar } -// GetTraitsTrait includes the requested fields of the GraphQL type Trait. -type GetTraitsTrait struct { - Id uuid.UUID `json:"id"` - Source Source `json:"source"` - Label TraitLabel `json:"label"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` -} - -// GetId returns GetTraitsTrait.Id, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetId() uuid.UUID { return v.Id } - -// GetSource returns GetTraitsTrait.Source, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetSource() Source { return v.Source } - -// GetLabel returns GetTraitsTrait.Label, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetLabel() TraitLabel { return v.Label } - -// GetValue returns GetTraitsTrait.Value, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetValue() string { return v.Value } - -// GetTimestamp returns GetTraitsTrait.Timestamp, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetTimestamp() time.Time { return v.Timestamp } - type IdentifierType string const ( @@ -1334,20 +986,18 @@ const ( IdentifierTypeTvdb IdentifierType = "TVDB" IdentifierTypeTvmaze IdentifierType = "TVMAZE" IdentifierTypeUber IdentifierType = "UBER" - IdentifierTypeBooking IdentifierType = "BOOKING" IdentifierTypeInstacart IdentifierType = "INSTACART" - IdentifierTypeUbereats IdentifierType = "UBEREATS" ) // InstacartActivityMetadata includes the GraphQL fields of InstacartActivityMetadata requested by the fragment InstacartActivityMetadata. type InstacartActivityMetadata struct { - Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` - Retailer string `json:"retailer"` - TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` - DateOrdered graphqlTypes.Date `json:"dateOrdered"` - DateDelivered graphqlTypes.Date `json:"dateDelivered"` - StatusString string `json:"statusString"` - InstacartActivityMetadataItems []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem `json:"InstacartActivityMetadataItems"` + Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` + Retailer string `json:"retailer"` + TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` + DateOrdered graphqlTypes.Date `json:"dateOrdered"` + DateDelivered graphqlTypes.Date `json:"dateDelivered"` + StatusString string `json:"statusString"` + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` } // GetSubject returns InstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. @@ -1370,13 +1020,13 @@ func (v *InstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { retur // GetStatusString returns InstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. func (v *InstacartActivityMetadata) GetStatusString() string { return v.StatusString } -// GetInstacartActivityMetadataItems returns InstacartActivityMetadata.InstacartActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetInstacartActivityMetadataItems() []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem { - return v.InstacartActivityMetadataItems +// GetItems returns InstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.Items } -// InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem includes the requested fields of the GraphQL type InstacartOrderItem. -type InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem struct { +// InstacartActivityMetadataItemsInstacartOrderItem includes the requested fields of the GraphQL type InstacartOrderItem. +type InstacartActivityMetadataItemsInstacartOrderItem struct { ItemID string `json:"itemID"` ProductName string `json:"productName"` UnitPrice string `json:"unitPrice"` @@ -1384,28 +1034,24 @@ type InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem s QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` } -// GetItemID returns InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem.ItemID, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem) GetItemID() string { - return v.ItemID -} +// GetItemID returns InstacartActivityMetadataItemsInstacartOrderItem.ItemID, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetItemID() string { return v.ItemID } -// GetProductName returns InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem.ProductName, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem) GetProductName() string { +// GetProductName returns InstacartActivityMetadataItemsInstacartOrderItem.ProductName, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetProductName() string { return v.ProductName } -// GetUnitPrice returns InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem.UnitPrice, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem) GetUnitPrice() string { - return v.UnitPrice -} +// GetUnitPrice returns InstacartActivityMetadataItemsInstacartOrderItem.UnitPrice, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetUnitPrice() string { return v.UnitPrice } -// GetStatus returns InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem.Status, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem) GetStatus() InstacartItemStatus { +// GetStatus returns InstacartActivityMetadataItemsInstacartOrderItem.Status, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetStatus() InstacartItemStatus { return v.Status } -// GetQuantityPurchased returns InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { +// GetQuantityPurchased returns InstacartActivityMetadataItemsInstacartOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { return v.QuantityPurchased } @@ -1513,12 +1159,10 @@ func (v *LookupActivity) __premarshalJSON() (*__premarshalLookupActivity, error) // // LookupActivityMetadata is implemented by the following types: // LookupActivityMetadataAmazonActivityMetadata -// LookupActivityMetadataBookingActivityMetadata // LookupActivityMetadataInstacartActivityMetadata // LookupActivityMetadataNetflixActivityMetadata // LookupActivityMetadataPlaystationActivityMetadata // LookupActivityMetadataUberActivityMetadata -// LookupActivityMetadataUberEatsActivityMetadata // LookupActivityMetadataYoutubeActivityMetadata type LookupActivityMetadata interface { implementsGraphQLInterfaceLookupActivityMetadata() @@ -1528,8 +1172,6 @@ type LookupActivityMetadata interface { func (v *LookupActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { } -func (v *LookupActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} func (v *LookupActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { } func (v *LookupActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { @@ -1538,8 +1180,6 @@ func (v *LookupActivityMetadataPlaystationActivityMetadata) implementsGraphQLInt } func (v *LookupActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { } -func (v *LookupActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} func (v *LookupActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { } @@ -1560,9 +1200,6 @@ func __unmarshalLookupActivityMetadata(b []byte, v *LookupActivityMetadata) erro case "AmazonActivityMetadata": *v = new(LookupActivityMetadataAmazonActivityMetadata) return json.Unmarshal(b, *v) - case "BookingActivityMetadata": - *v = new(LookupActivityMetadataBookingActivityMetadata) - return json.Unmarshal(b, *v) case "InstacartActivityMetadata": *v = new(LookupActivityMetadataInstacartActivityMetadata) return json.Unmarshal(b, *v) @@ -1575,9 +1212,6 @@ func __unmarshalLookupActivityMetadata(b []byte, v *LookupActivityMetadata) erro case "UberActivityMetadata": *v = new(LookupActivityMetadataUberActivityMetadata) return json.Unmarshal(b, *v) - case "UberEatsActivityMetadata": - *v = new(LookupActivityMetadataUberEatsActivityMetadata) - return json.Unmarshal(b, *v) case "YoutubeActivityMetadata": *v = new(LookupActivityMetadataYoutubeActivityMetadata) return json.Unmarshal(b, *v) @@ -1606,18 +1240,6 @@ func __marshalLookupActivityMetadata(v *LookupActivityMetadata) ([]byte, error) *__premarshalLookupActivityMetadataAmazonActivityMetadata }{typename, premarshaled} return json.Marshal(result) - case *LookupActivityMetadataBookingActivityMetadata: - typename = "BookingActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataBookingActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) case *LookupActivityMetadataInstacartActivityMetadata: typename = "InstacartActivityMetadata" @@ -1666,18 +1288,6 @@ func __marshalLookupActivityMetadata(v *LookupActivityMetadata) ([]byte, error) *__premarshalLookupActivityMetadataUberActivityMetadata }{typename, premarshaled} return json.Marshal(result) - case *LookupActivityMetadataUberEatsActivityMetadata: - typename = "UberEatsActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataUberEatsActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) case *LookupActivityMetadataYoutubeActivityMetadata: typename = "YoutubeActivityMetadata" @@ -1791,46 +1401,61 @@ func (v *LookupActivityMetadataAmazonActivityMetadata) __premarshalJSON() (*__pr return &retval, nil } -// LookupActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. -type LookupActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - BookingActivityMetadata `json:"-"` +// LookupActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. +type LookupActivityMetadataInstacartActivityMetadata struct { + Typename string `json:"__typename"` + InstacartActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetTypename() string { return v.Typename } + +// GetSubject returns LookupActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { + return v.InstacartActivityMetadata.Subject +} + +// GetRetailer returns LookupActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetRetailer() string { + return v.InstacartActivityMetadata.Retailer } -// GetTypename returns LookupActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetTypename() string { return v.Typename } +// GetTotalOrderAmountSpent returns LookupActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { + return v.InstacartActivityMetadata.TotalOrderAmountSpent +} -// GetSubject returns LookupActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.BookingActivityMetadata.Subject +// GetDateOrdered returns LookupActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateOrdered } -// GetBookingID returns LookupActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetBookingID() string { - return v.BookingActivityMetadata.BookingID +// GetDateDelivered returns LookupActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateDelivered } -// GetPrice returns LookupActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetPrice() string { - return v.BookingActivityMetadata.Price +// GetStatusString returns LookupActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetStatusString() string { + return v.InstacartActivityMetadata.StatusString } -// GetBookings returns LookupActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.BookingActivityMetadata.Bookings +// GetItems returns LookupActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.InstacartActivityMetadata.Items } -func (v *LookupActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { +func (v *LookupActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { if string(b) == "null" { return nil } var firstPass struct { - *LookupActivityMetadataBookingActivityMetadata + *LookupActivityMetadataInstacartActivityMetadata graphql.NoUnmarshalJSON } - firstPass.LookupActivityMetadataBookingActivityMetadata = v + firstPass.LookupActivityMetadataInstacartActivityMetadata = v err := json.Unmarshal(b, &firstPass) if err != nil { @@ -1838,26 +1463,32 @@ func (v *LookupActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) } err = json.Unmarshal( - b, &v.BookingActivityMetadata) + b, &v.InstacartActivityMetadata) if err != nil { return err } return nil } -type __premarshalLookupActivityMetadataBookingActivityMetadata struct { +type __premarshalLookupActivityMetadataInstacartActivityMetadata struct { Typename string `json:"__typename"` - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` + Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` + + Retailer string `json:"retailer"` + + TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` + + DateOrdered graphqlTypes.Date `json:"dateOrdered"` - BookingID string `json:"bookingID"` + DateDelivered graphqlTypes.Date `json:"dateDelivered"` - Price string `json:"price"` + StatusString string `json:"statusString"` - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` } -func (v *LookupActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { +func (v *LookupActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { premarshaled, err := v.__premarshalJSON() if err != nil { return nil, err @@ -1865,114 +1496,8 @@ func (v *LookupActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, e return json.Marshal(premarshaled) } -func (v *LookupActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataBookingActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataBookingActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.BookingActivityMetadata.Subject - retval.BookingID = v.BookingActivityMetadata.BookingID - retval.Price = v.BookingActivityMetadata.Price - retval.Bookings = v.BookingActivityMetadata.Bookings - return &retval, nil -} - -// LookupActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. -type LookupActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - InstacartActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { - return v.InstacartActivityMetadata.Subject -} - -// GetRetailer returns LookupActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetRetailer() string { - return v.InstacartActivityMetadata.Retailer -} - -// GetTotalOrderAmountSpent returns LookupActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { - return v.InstacartActivityMetadata.TotalOrderAmountSpent -} - -// GetDateOrdered returns LookupActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateOrdered -} - -// GetDateDelivered returns LookupActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateDelivered -} - -// GetStatusString returns LookupActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetStatusString() string { - return v.InstacartActivityMetadata.StatusString -} - -// GetInstacartActivityMetadataItems returns LookupActivityMetadataInstacartActivityMetadata.InstacartActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetInstacartActivityMetadataItems() []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem { - return v.InstacartActivityMetadata.InstacartActivityMetadataItems -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataInstacartActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataInstacartActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.InstacartActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` - - Retailer string `json:"retailer"` - - TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` - - DateOrdered graphqlTypes.Date `json:"dateOrdered"` - - DateDelivered graphqlTypes.Date `json:"dateDelivered"` - - StatusString string `json:"statusString"` - - InstacartActivityMetadataItems []InstacartActivityMetadataInstacartActivityMetadataItemsInstacartOrderItem `json:"InstacartActivityMetadataItems"` -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataInstacartActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataInstacartActivityMetadata +func (v *LookupActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataInstacartActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataInstacartActivityMetadata retval.Typename = v.Typename retval.Subject = v.InstacartActivityMetadata.Subject @@ -1981,7 +1506,7 @@ func (v *LookupActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*_ retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered retval.StatusString = v.InstacartActivityMetadata.StatusString - retval.InstacartActivityMetadataItems = v.InstacartActivityMetadata.InstacartActivityMetadataItems + retval.Items = v.InstacartActivityMetadata.Items return &retval, nil } @@ -2256,115 +1781,6 @@ func (v *LookupActivityMetadataUberActivityMetadata) __premarshalJSON() (*__prem return &retval, nil } -// LookupActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. -type LookupActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - UberEatsActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.UberEatsActivityMetadata.Subject -} - -// GetDate returns LookupActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { - return v.UberEatsActivityMetadata.Date -} - -// GetRestaurant returns LookupActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { - return v.UberEatsActivityMetadata.Restaurant -} - -// GetCurrency returns LookupActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetCurrency() string { - return v.UberEatsActivityMetadata.Currency -} - -// GetTotalPrice returns LookupActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { - return v.UberEatsActivityMetadata.TotalPrice -} - -// GetUberEatsActivityMetadataStatus returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus -} - -// GetItems returns LookupActivityMetadataUberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetItems() []UberEatsActivityMetadataItemsUberEatsOrderItem { - return v.UberEatsActivityMetadata.Items -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataUberEatsActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataUberEatsActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberEatsActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - Restaurant string `json:"restaurant"` - - Currency string `json:"currency"` - - TotalPrice float64 `json:"totalPrice"` - - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - - Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataUberEatsActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataUberEatsActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberEatsActivityMetadata.Subject - retval.Date = v.UberEatsActivityMetadata.Date - retval.Restaurant = v.UberEatsActivityMetadata.Restaurant - retval.Currency = v.UberEatsActivityMetadata.Currency - retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus - retval.Items = v.UberEatsActivityMetadata.Items - return &retval, nil -} - // LookupActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. type LookupActivityMetadataYoutubeActivityMetadata struct { Typename string `json:"__typename"` @@ -2458,30 +1874,6 @@ func (v *LookupActivityMetadataYoutubeActivityMetadata) __premarshalJSON() (*__p return &retval, nil } -// LookupTrait includes the requested fields of the GraphQL type Trait. -type LookupTrait struct { - Id uuid.UUID `json:"id"` - Source Source `json:"source"` - Label TraitLabel `json:"label"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` -} - -// GetId returns LookupTrait.Id, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetId() uuid.UUID { return v.Id } - -// GetSource returns LookupTrait.Source, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetSource() Source { return v.Source } - -// GetLabel returns LookupTrait.Label, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetLabel() TraitLabel { return v.Label } - -// GetValue returns LookupTrait.Value, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetValue() string { return v.Value } - -// GetTimestamp returns LookupTrait.Timestamp, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetTimestamp() time.Time { return v.Timestamp } - // NetflixActivityMetadata includes the GraphQL fields of NetflixActivityMetadata requested by the fragment NetflixActivityMetadata. type NetflixActivityMetadata struct { Title string `json:"title"` @@ -2558,29 +1950,7 @@ const ( SourceYoutube Source = "YOUTUBE" SourceAmazon Source = "AMAZON" SourceUber Source = "UBER" - SourceBooking Source = "BOOKING" SourceInstacart Source = "INSTACART" - SourceInstagram Source = "INSTAGRAM" - SourceX Source = "X" - SourceUbereats Source = "UBEREATS" - SourceGandalf Source = "GANDALF" -) - -type TraitLabel string - -const ( - TraitLabelPrimeSubscriber TraitLabel = "PRIME_SUBSCRIBER" - TraitLabelRating TraitLabel = "RATING" - TraitLabelTripCount TraitLabel = "TRIP_COUNT" - TraitLabelAccountCreatedOn TraitLabel = "ACCOUNT_CREATED_ON" - TraitLabelPlan TraitLabel = "PLAN" - TraitLabelGeniusLevel TraitLabel = "GENIUS_LEVEL" - TraitLabelFollowerCount TraitLabel = "FOLLOWER_COUNT" - TraitLabelFollowingCount TraitLabel = "FOLLOWING_COUNT" - TraitLabelUsername TraitLabel = "USERNAME" - TraitLabelPostCount TraitLabel = "POST_COUNT" - TraitLabelEmail TraitLabel = "EMAIL" - TraitLabelOrderCount TraitLabel = "ORDER_COUNT" ) type TripStatus string @@ -2637,114 +2007,6 @@ func (v *UberActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierTy return v.IdentifierType } -// UberEatsActivityMetadata includes the GraphQL fields of UberEatsActivityMetadata requested by the fragment UberEatsActivityMetadata. -type UberEatsActivityMetadata struct { - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - Restaurant string `json:"restaurant"` - Currency string `json:"currency"` - TotalPrice float64 `json:"totalPrice"` - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - Items []UberEatsActivityMetadataItemsUberEatsOrderItem `json:"items"` -} - -// GetSubject returns UberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetDate returns UberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } - -// GetRestaurant returns UberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetRestaurant() string { return v.Restaurant } - -// GetCurrency returns UberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetCurrency() string { return v.Currency } - -// GetTotalPrice returns UberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetTotalPrice() float64 { return v.TotalPrice } - -// GetUberEatsActivityMetadataStatus returns UberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadataStatus -} - -// GetItems returns UberEatsActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetItems() []UberEatsActivityMetadataItemsUberEatsOrderItem { - return v.Items -} - -// UberEatsActivityMetadataItemsUberEatsOrderItem includes the requested fields of the GraphQL type UberEatsOrderItem. -type UberEatsActivityMetadataItemsUberEatsOrderItem struct { - Name string `json:"name"` - Price string `json:"price"` - QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` - Customizations []UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations `json:"customizations"` -} - -// GetName returns UberEatsActivityMetadataItemsUberEatsOrderItem.Name, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItem) GetName() string { return v.Name } - -// GetPrice returns UberEatsActivityMetadataItemsUberEatsOrderItem.Price, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItem) GetPrice() string { return v.Price } - -// GetQuantityPurchased returns UberEatsActivityMetadataItemsUberEatsOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { - return v.QuantityPurchased -} - -// GetCustomizations returns UberEatsActivityMetadataItemsUberEatsOrderItem.Customizations, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItem) GetCustomizations() []UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations { - return v.Customizations -} - -// UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations includes the requested fields of the GraphQL type UberEatsOrderItemCustomizations. -type UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations struct { - Customization string `json:"customization"` - Value string `json:"value"` - Quantity graphqlTypes.Int64 `json:"quantity"` -} - -// GetCustomization returns UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Customization, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetCustomization() string { - return v.Customization -} - -// GetValue returns UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Value, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetValue() string { - return v.Value -} - -// GetQuantity returns UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Quantity, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetQuantity() graphqlTypes.Int64 { - return v.Quantity -} - -// UberEatsActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type UberEatsActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns UberEatsActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns UberEatsActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -type UberEatsOrderStatus string - -const ( - UberEatsOrderStatusSuccess UberEatsOrderStatus = "SUCCESS" - UberEatsOrderStatusEaterCancelled UberEatsOrderStatus = "EATER_CANCELLED" - UberEatsOrderStatusRestaurantCancelled UberEatsOrderStatus = "RESTAURANT_CANCELLED" - UberEatsOrderStatusRestaurantUnfulfilled UberEatsOrderStatus = "RESTAURANT_UNFULFILLED" - UberEatsOrderStatusUnknown UberEatsOrderStatus = "UNKNOWN" -) - // YoutubeActivityMetadata includes the GraphQL fields of YoutubeActivityMetadata requested by the fragment YoutubeActivityMetadata. type YoutubeActivityMetadata struct { Title string `json:"title"` @@ -2787,19 +2049,15 @@ func (v *YoutubeActivityMetadataSubjectIdentifier) GetIdentifierType() Identifie // __getActivityInput is used internally by genqlient type __getActivityInput struct { - DataKey string `json:"dataKey"` - ActivityType []ActivityType `json:"activityType"` - Source Source `json:"source"` - Limit graphqlTypes.Int64 `json:"limit"` - Page graphqlTypes.Int64 `json:"page"` + DataKey string `json:"dataKey"` + Source Source `json:"source"` + Limit graphqlTypes.Int64 `json:"limit"` + Page graphqlTypes.Int64 `json:"page"` } // GetDataKey returns __getActivityInput.DataKey, and is useful for accessing the field via an interface. func (v *__getActivityInput) GetDataKey() string { return v.DataKey } -// GetActivityType returns __getActivityInput.ActivityType, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetActivityType() []ActivityType { return v.ActivityType } - // GetSource returns __getActivityInput.Source, and is useful for accessing the field via an interface. func (v *__getActivityInput) GetSource() Source { return v.Source } @@ -2817,22 +2075,6 @@ type __getAppByPublicKeyInput struct { // GetPublicKey returns __getAppByPublicKeyInput.PublicKey, and is useful for accessing the field via an interface. func (v *__getAppByPublicKeyInput) GetPublicKey() string { return v.PublicKey } -// __getTraitsInput is used internally by genqlient -type __getTraitsInput struct { - DataKey string `json:"dataKey"` - Source Source `json:"source"` - Labels []TraitLabel `json:"labels"` -} - -// GetDataKey returns __getTraitsInput.DataKey, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetDataKey() string { return v.DataKey } - -// GetSource returns __getTraitsInput.Source, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetSource() Source { return v.Source } - -// GetLabels returns __getTraitsInput.Labels, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetLabels() []TraitLabel { return v.Labels } - // __lookupActivityInput is used internally by genqlient type __lookupActivityInput struct { DataKey string `json:"dataKey"` @@ -2845,18 +2087,6 @@ func (v *__lookupActivityInput) GetDataKey() string { return v.DataKey } // GetActivityId returns __lookupActivityInput.ActivityId, and is useful for accessing the field via an interface. func (v *__lookupActivityInput) GetActivityId() uuid.UUID { return v.ActivityId } -// __lookupTraitInput is used internally by genqlient -type __lookupTraitInput struct { - DataKey string `json:"dataKey"` - TraitId uuid.UUID `json:"traitId"` -} - -// GetDataKey returns __lookupTraitInput.DataKey, and is useful for accessing the field via an interface. -func (v *__lookupTraitInput) GetDataKey() string { return v.DataKey } - -// GetTraitId returns __lookupTraitInput.TraitId, and is useful for accessing the field via an interface. -func (v *__lookupTraitInput) GetTraitId() uuid.UUID { return v.TraitId } - // getActivityResponse is returned by getActivity on success. type getActivityResponse struct { GetActivity GetActivityActivityResponse `json:"getActivity"` @@ -2875,14 +2105,6 @@ func (v *getAppByPublicKeyResponse) GetGetAppByPublicKey() GetAppByPublicKeyAppl return v.GetAppByPublicKey } -// getTraitsResponse is returned by getTraits on success. -type getTraitsResponse struct { - GetTraits []GetTraitsTrait `json:"getTraits"` -} - -// GetGetTraits returns getTraitsResponse.GetTraits, and is useful for accessing the field via an interface. -func (v *getTraitsResponse) GetGetTraits() []GetTraitsTrait { return v.GetTraits } - // lookupActivityResponse is returned by lookupActivity on success. type lookupActivityResponse struct { LookupActivity LookupActivity `json:"lookupActivity"` @@ -2891,18 +2113,10 @@ type lookupActivityResponse struct { // GetLookupActivity returns lookupActivityResponse.LookupActivity, and is useful for accessing the field via an interface. func (v *lookupActivityResponse) GetLookupActivity() LookupActivity { return v.LookupActivity } -// lookupTraitResponse is returned by lookupTrait on success. -type lookupTraitResponse struct { - LookupTrait LookupTrait `json:"lookupTrait"` -} - -// GetLookupTrait returns lookupTraitResponse.LookupTrait, and is useful for accessing the field via an interface. -func (v *lookupTraitResponse) GetLookupTrait() LookupTrait { return v.LookupTrait } - // The query or mutation executed by getActivity. const getActivity_Operation = ` -query getActivity ($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { - getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { +query getActivity ($dataKey: String!, $source: Source!, $limit: Int64!, $page: Int64!) { + getActivity(dataKey: $dataKey, source: $source, limit: $limit, page: $page) { ... on ActivityResponse { data { ... on Activity { @@ -2912,11 +2126,9 @@ query getActivity ($dataKey: String!, $activityType: [ActivityType], $source: So ... NetflixActivityMetadata ... PlaystationActivityMetadata ... AmazonActivityMetadata - ... BookingActivityMetadata ... YoutubeActivityMetadata ... UberActivityMetadata ... InstacartActivityMetadata - ... UberEatsActivityMetadata } } } @@ -2959,27 +2171,6 @@ fragment AmazonActivityMetadata on AmazonActivityMetadata { quantityPurchased totalCost } -fragment BookingActivityMetadata on BookingActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - bookingID - price - bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType - } - } -} fragment YoutubeActivityMetadata on YoutubeActivityMetadata { title subject { @@ -3018,7 +2209,7 @@ fragment InstacartActivityMetadata on InstacartActivityMetadata { dateOrdered dateDelivered statusString - InstacartActivityMetadataItems: items { + items { ... on InstacartOrderItem { itemID productName @@ -3028,39 +2219,11 @@ fragment InstacartActivityMetadata on InstacartActivityMetadata { } } } -fragment UberEatsActivityMetadata on UberEatsActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - date - restaurant - currency - totalPrice - UberEatsActivityMetadataStatus: status - items { - ... on UberEatsOrderItem { - name - price - quantityPurchased - customizations { - ... on UberEatsOrderItemCustomizations { - customization - value - quantity - } - } - } - } -} ` func (eye EyeOfSauron) GetActivity( ctx_ context.Context, dataKey string, - activityType []ActivityType, source Source, limit graphqlTypes.Int64, page graphqlTypes.Int64, @@ -3068,7 +2231,6 @@ func (eye EyeOfSauron) GetActivity( req := graphql2.NewRequest(getActivity_Operation) req.Var("dataKey", dataKey) - req.Var("activityType", activityType) req.Var("source", source) req.Var("limit", limit) req.Var("page", page) @@ -3162,66 +2324,6 @@ func (eye EyeOfSauron) GetAppByPublicKey( return &resp_, nil } -// The query or mutation executed by getTraits. -const getTraits_Operation = ` -query getTraits ($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { - getTraits(dataKey: $dataKey, source: $source, labels: $labels) { - ... on Trait { - id - source - label - value - timestamp - } - } -} -` - -func (eye EyeOfSauron) GetTraits( - ctx_ context.Context, - dataKey string, - source Source, - labels []TraitLabel, -) (*getTraitsResponse, error) { - req := graphql2.NewRequest(getTraits_Operation) - - req.Var("dataKey", dataKey) - req.Var("source", source) - req.Var("labels", labels) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ getTraitsResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} - // The query or mutation executed by lookupActivity. const lookupActivity_Operation = ` query lookupActivity ($dataKey: String!, $activityId: UUID!) { @@ -3233,11 +2335,9 @@ query lookupActivity ($dataKey: String!, $activityId: UUID!) { ... NetflixActivityMetadata ... PlaystationActivityMetadata ... AmazonActivityMetadata - ... BookingActivityMetadata ... YoutubeActivityMetadata ... UberActivityMetadata ... InstacartActivityMetadata - ... UberEatsActivityMetadata } } } @@ -3275,27 +2375,6 @@ fragment AmazonActivityMetadata on AmazonActivityMetadata { quantityPurchased totalCost } -fragment BookingActivityMetadata on BookingActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - bookingID - price - bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType - } - } -} fragment YoutubeActivityMetadata on YoutubeActivityMetadata { title subject { @@ -3334,7 +2413,7 @@ fragment InstacartActivityMetadata on InstacartActivityMetadata { dateOrdered dateDelivered statusString - InstacartActivityMetadataItems: items { + items { ... on InstacartOrderItem { itemID productName @@ -3344,33 +2423,6 @@ fragment InstacartActivityMetadata on InstacartActivityMetadata { } } } -fragment UberEatsActivityMetadata on UberEatsActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - date - restaurant - currency - totalPrice - UberEatsActivityMetadataStatus: status - items { - ... on UberEatsOrderItem { - name - price - quantityPurchased - customizations { - ... on UberEatsOrderItemCustomizations { - customization - value - quantity - } - } - } - } -} ` func (eye EyeOfSauron) LookupActivity( @@ -3415,61 +2467,3 @@ func (eye EyeOfSauron) LookupActivity( return &resp_, nil } - -// The query or mutation executed by lookupTrait. -const lookupTrait_Operation = ` -query lookupTrait ($dataKey: String!, $traitId: UUID!) { - lookupTrait(dataKey: $dataKey, traitId: $traitId) { - ... on Trait { - id - source - label - value - timestamp - } - } -} -` - -func (eye EyeOfSauron) LookupTrait( - ctx_ context.Context, - dataKey string, - traitId uuid.UUID, -) (*lookupTraitResponse, error) { - req := graphql2.NewRequest(lookupTrait_Operation) - - req.Var("dataKey", dataKey) - req.Var("traitId", traitId) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ lookupTraitResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} diff --git a/eyeofsauron/example/main.go b/eyeofsauron/example/main.go index 30a30b5..33fd6c5 100644 --- a/eyeofsauron/example/main.go +++ b/eyeofsauron/example/main.go @@ -1,7 +1,6 @@ package main import ( - "context" "encoding/json" "fmt" @@ -12,38 +11,37 @@ import ( ) func main() { - // eye, err := generated.NewEyeOfSauron("0x366a5ae7c7575f8cb0e3832ad53e668061e0ad800b94ffb75fd5b6d241a83e56") - // if err != nil { - // log.Fatalf("failed to run gandalf client: %s", err) - // } - - - // response, err := eye.GetActivity( - // context.Background(), - // "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", - // []generated.ActivityType{generated.ActivityTypePlay}, - // generated.SourceNetflix, - // 100, - // 1, - // ) - - // if err != nil { - // log.Fatalf("failed to run gandalf client: %s", err) - // } - - // for _, activity := range response.GetGetActivity().Data { - // activityID, _ := uuid.Parse(activity.Id) - // response, err := eye.LookupActivity( - // context.Background(), - // "BG7u85FMLGnYnUv2ZsFTAXrGT2Xw3TikrBHm2kYz31qq", - // activityID, - // ) - - // if err != nil { - // log.Fatalf("unable to look up activity: %s", err) - // } - // printLookupActivityMetadata(response.LookupActivity.GetMetadata()) - // } + eye, err := generated.NewEyeOfSauron("0x366a5ae7c7575f8cb0e3832ad53e668061e0ad800b94ffb75fd5b6d241a83e56") + if err != nil { + log.Fatalf("failed to run gandalf client: %s", err) + } + + response, err := eye.GetActivity( + context.Background(), + "3pLT1hCieyPQQb876i24D34Qf8y6Yyke5m4rhPRhV67D", + []generated.ActivityType{generated.ActivityTypeWatch}, + generated.SourceNetflix, + 100, + 1, + ) + + if err != nil { + log.Fatalf("failed to run gandalf client: %s", err) + } + + for _, activity := range response.GetGetActivity().Data { + activityID, _ := uuid.Parse(activity.Id) + response, err := eye.LookupActivity( + context.Background(), + "3pLT1hCieyPQQb876i24D34Qf8y6Yyke5m4rhPRhV67D", + activityID, + ) + + if err != nil { + log.Fatalf("unable to look up activity: %s", err) + } + printLookupActivityMetadata(response.LookupActivity.GetMetadata()) + } getTrait() lookupTrait() @@ -110,7 +108,7 @@ func printJSON(v interface{}) { func getTrait() { // Initialization - eye, err := generated.NewEyeOfSauron("8c48ad0e5892d51d8e2e411a77a1d73ebe764b619c846d1cab3dc45ee172e8ca") + eye, err := generated.NewEyeOfSauron("8c48ad0e5892d51d8e2e411a77a1d73ebe764b619c846d1cab3dc45ee172e8ca") if err != nil { log.Fatalf("failed to run gandalf client: %s", err) } @@ -140,4 +138,4 @@ func lookupTrait() { } fmt.Println("Lookup Trait", response.GetLookupTrait()) -} \ No newline at end of file +} From 57e3c5cf14b4ed38add70f77fb92adf61a6d3c56 Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 14:48:46 +0000 Subject: [PATCH 11/14] Update docs Signed-off-by: Bashorun97 --- README.md | 46 +- example/generated/generated.go | 3475 +++++++++++++++++++++++++++ example/generated/genqlient.graphql | 136 +- go.mod | 1 - 4 files changed, 3556 insertions(+), 102 deletions(-) create mode 100644 example/generated/generated.go diff --git a/README.md b/README.md index a083e81..7377605 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ import ( "log" "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/example/generated" + "github.com/gandalf-network/gandalf-sdk-go/connect" ) func main() { @@ -59,21 +60,14 @@ import ( "encoding/json" "fmt" "log" - - "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/example/generated" ) -func main() { - // Initialization - eye, err := generated.NewEyeOfSauron(" Date: Sat, 15 Jun 2024 15:03:02 +0000 Subject: [PATCH 12/14] Clean up redundant generated files Signed-off-by: Bashorun97 --- eyeofsauron/example/generated/generated.go | 3475 +++++++++++++++++ .../example/generated/genqlient.graphql | 216 + eyeofsauron/example/generated/genqlient.yaml | 14 + eyeofsauron/example/generated/schema.graphql | 247 ++ eyeofsauron/example/main.go | 2 +- 5 files changed, 3953 insertions(+), 1 deletion(-) create mode 100644 eyeofsauron/example/generated/generated.go create mode 100644 eyeofsauron/example/generated/genqlient.graphql create mode 100644 eyeofsauron/example/generated/genqlient.yaml create mode 100644 eyeofsauron/example/generated/schema.graphql diff --git a/eyeofsauron/example/generated/generated.go b/eyeofsauron/example/generated/generated.go new file mode 100644 index 0000000..88b5001 --- /dev/null +++ b/eyeofsauron/example/generated/generated.go @@ -0,0 +1,3475 @@ +// Code generated by github.com/gandalf-network/gandalf-sdk-go/eyeofsauron, DO NOT EDIT. + +package generated + +import ( + "bytes" + "context" + "crypto/ecdsa" + "crypto/rand" + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "encoding/json" + "fmt" + "strings" + "time" + + "github.com/btcsuite/btcd/btcec/v2" + graphql2 "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphql" + "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes" + "github.com/gandalf-network/genqlient/graphql" + "github.com/google/uuid" +) + +type EyeOfSauron struct { + client *graphql2.Client + privateKey *ecdsa.PrivateKey +} + +func NewEyeOfSauron(privateKey string) (*EyeOfSauron, error) { + client := graphql2.NewClient("https://sauron.gandalf.network/public/gql") + privKey, err := HexToECDSAPrivateKey(privateKey) + if err != nil { + return nil, fmt.Errorf("failed to parse private key: %v", err) + } + return &EyeOfSauron{ + privateKey: privKey, + client: client, + }, nil +} + +// HexToECDSAPrivateKey converts a hexadecimal string representing a private key +// into an *ecdsa.PrivateKey for the secp256k1 curve. +func HexToECDSAPrivateKey(hexKey string) (*ecdsa.PrivateKey, error) { + trimmedHexKey := strings.TrimPrefix(hexKey, "0x") + + privKeyBytes, err := hex.DecodeString(trimmedHexKey) + if err != nil { + return nil, fmt.Errorf("failed to decode hex string: %v", err) + } + + privKey, _ := btcec.PrivKeyFromBytes(privKeyBytes) + + return privKey.ToECDSA(), nil +} + +// SignMessage signs a message using the given ECDSA private key. +func SignMessageAsBase64(privKey *ecdsa.PrivateKey, message []byte) (string, error) { + hash := sha256.Sum256(message) + + signature, err := ecdsa.SignASN1(rand.Reader, privKey, hash[:]) + if err != nil { + return "", fmt.Errorf("failed to sign message: %v", err) + } + + signatureB64 := base64.StdEncoding.EncodeToString(signature) + + return signatureB64, nil +} + +type ActivityType string + +const ( + ActivityTypeTrip ActivityType = "TRIP" + ActivityTypeStay ActivityType = "STAY" + ActivityTypeShop ActivityType = "SHOP" + ActivityTypePlay ActivityType = "PLAY" + ActivityTypeWatch ActivityType = "WATCH" +) + +// AmazonActivityMetadata includes the GraphQL fields of AmazonActivityMetadata requested by the fragment AmazonActivityMetadata. +type AmazonActivityMetadata struct { + ProductName string `json:"productName"` + Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` + Date graphqlTypes.Date `json:"date"` + QuantityPurchased int `json:"quantityPurchased"` + TotalCost string `json:"totalCost"` +} + +// GetProductName returns AmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadata) GetProductName() string { return v.ProductName } + +// GetSubject returns AmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetDate returns AmazonActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } + +// GetQuantityPurchased returns AmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadata) GetQuantityPurchased() int { return v.QuantityPurchased } + +// GetTotalCost returns AmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadata) GetTotalCost() string { return v.TotalCost } + +// AmazonActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type AmazonActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns AmazonActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns AmazonActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *AmazonActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +// BookingActivityMetadata includes the GraphQL fields of BookingActivityMetadata requested by the fragment BookingActivityMetadata. +type BookingActivityMetadata struct { + Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` + BookingID string `json:"bookingID"` + Price string `json:"price"` + Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` +} + +// GetSubject returns BookingActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetBookingID returns BookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadata) GetBookingID() string { return v.BookingID } + +// GetPrice returns BookingActivityMetadata.Price, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadata) GetPrice() string { return v.Price } + +// GetBookings returns BookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { + return v.Bookings +} + +// BookingActivityMetadataBookingsBookingItem includes the requested fields of the GraphQL type BookingItem. +type BookingActivityMetadataBookingsBookingItem struct { + StartDateTime time.Time `json:"startDateTime"` + EndDateTime time.Time `json:"endDateTime"` + Address string `json:"address"` + DepatureLocation string `json:"depatureLocation"` + ArrivalLocation string `json:"arrivalLocation"` + LayoverLocations []string `json:"layoverLocations"` + ActivityType ActivityType `json:"activityType"` +} + +// GetStartDateTime returns BookingActivityMetadataBookingsBookingItem.StartDateTime, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetStartDateTime() time.Time { + return v.StartDateTime +} + +// GetEndDateTime returns BookingActivityMetadataBookingsBookingItem.EndDateTime, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetEndDateTime() time.Time { return v.EndDateTime } + +// GetAddress returns BookingActivityMetadataBookingsBookingItem.Address, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetAddress() string { return v.Address } + +// GetDepatureLocation returns BookingActivityMetadataBookingsBookingItem.DepatureLocation, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetDepatureLocation() string { + return v.DepatureLocation +} + +// GetArrivalLocation returns BookingActivityMetadataBookingsBookingItem.ArrivalLocation, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetArrivalLocation() string { + return v.ArrivalLocation +} + +// GetLayoverLocations returns BookingActivityMetadataBookingsBookingItem.LayoverLocations, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetLayoverLocations() []string { + return v.LayoverLocations +} + +// GetActivityType returns BookingActivityMetadataBookingsBookingItem.ActivityType, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataBookingsBookingItem) GetActivityType() ActivityType { + return v.ActivityType +} + +// BookingActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type BookingActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns BookingActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns BookingActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *BookingActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +type ContentType string + +const ( + ContentTypeVideo ContentType = "VIDEO" + ContentTypeShorts ContentType = "SHORTS" + ContentTypeMusic ContentType = "MUSIC" +) + +// GetActivityActivityResponse includes the requested fields of the GraphQL type ActivityResponse. +type GetActivityActivityResponse struct { + Data []GetActivityActivityResponseDataActivity `json:"data"` + Limit graphqlTypes.Int64 `json:"limit"` + Total graphqlTypes.Int64 `json:"total"` + Page graphqlTypes.Int64 `json:"page"` +} + +// GetData returns GetActivityActivityResponse.Data, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponse) GetData() []GetActivityActivityResponseDataActivity { + return v.Data +} + +// GetLimit returns GetActivityActivityResponse.Limit, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponse) GetLimit() graphqlTypes.Int64 { return v.Limit } + +// GetTotal returns GetActivityActivityResponse.Total, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponse) GetTotal() graphqlTypes.Int64 { return v.Total } + +// GetPage returns GetActivityActivityResponse.Page, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponse) GetPage() graphqlTypes.Int64 { return v.Page } + +// GetActivityActivityResponseDataActivity includes the requested fields of the GraphQL type Activity. +type GetActivityActivityResponseDataActivity struct { + Id string `json:"id"` + Metadata GetActivityActivityResponseDataActivityMetadata `json:"-"` +} + +// GetId returns GetActivityActivityResponseDataActivity.Id, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivity) GetId() string { return v.Id } + +// GetMetadata returns GetActivityActivityResponseDataActivity.Metadata, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivity) GetMetadata() GetActivityActivityResponseDataActivityMetadata { + return v.Metadata +} + +func (v *GetActivityActivityResponseDataActivity) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivity + Metadata json.RawMessage `json:"metadata"` + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivity = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Metadata + src := firstPass.Metadata + if len(src) != 0 && string(src) != "null" { + err = __unmarshalGetActivityActivityResponseDataActivityMetadata( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal GetActivityActivityResponseDataActivity.Metadata: %w", err) + } + } + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivity struct { + Id string `json:"id"` + + Metadata json.RawMessage `json:"metadata"` +} + +func (v *GetActivityActivityResponseDataActivity) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivity) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivity, error) { + var retval __premarshalGetActivityActivityResponseDataActivity + + retval.Id = v.Id + { + + dst := &retval.Metadata + src := v.Metadata + var err error + *dst, err = __marshalGetActivityActivityResponseDataActivityMetadata( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal GetActivityActivityResponseDataActivity.Metadata: %w", err) + } + } + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadata includes the requested fields of the GraphQL interface ActivityMetadata. +// +// GetActivityActivityResponseDataActivityMetadata is implemented by the following types: +// GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata +// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata +// GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata +// GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata +// GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata +// GetActivityActivityResponseDataActivityMetadataUberActivityMetadata +// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata +// GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata +type GetActivityActivityResponseDataActivityMetadata interface { + implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { +} + +func __unmarshalGetActivityActivityResponseDataActivityMetadata(b []byte, v *GetActivityActivityResponseDataActivityMetadata) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "AmazonActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) + return json.Unmarshal(b, *v) + case "BookingActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) + return json.Unmarshal(b, *v) + case "InstacartActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) + return json.Unmarshal(b, *v) + case "NetflixActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) + return json.Unmarshal(b, *v) + case "PlaystationActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) + return json.Unmarshal(b, *v) + case "UberActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) + return json.Unmarshal(b, *v) + case "UberEatsActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) + return json.Unmarshal(b, *v) + case "YoutubeActivityMetadata": + *v = new(GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing ActivityMetadata.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for GetActivityActivityResponseDataActivityMetadata: "%v"`, tn.TypeName) + } +} + +func __marshalGetActivityActivityResponseDataActivityMetadata(v *GetActivityActivityResponseDataActivityMetadata) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata: + typename = "AmazonActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata: + typename = "BookingActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata: + typename = "InstacartActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata: + typename = "NetflixActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata: + typename = "PlaystationActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata: + typename = "UberActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata: + typename = "UberEatsActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata: + typename = "YoutubeActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for GetActivityActivityResponseDataActivityMetadata: "%T"`, v) + } +} + +// GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata includes the requested fields of the GraphQL type AmazonActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata struct { + Typename string `json:"__typename"` + AmazonActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetProductName returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetProductName() string { + return v.AmazonActivityMetadata.ProductName +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { + return v.AmazonActivityMetadata.Subject +} + +// GetDate returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetDate() graphqlTypes.Date { + return v.AmazonActivityMetadata.Date +} + +// GetQuantityPurchased returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetQuantityPurchased() int { + return v.AmazonActivityMetadata.QuantityPurchased +} + +// GetTotalCost returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetTotalCost() string { + return v.AmazonActivityMetadata.TotalCost +} + +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AmazonActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata struct { + Typename string `json:"__typename"` + + ProductName string `json:"productName"` + + Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + QuantityPurchased int `json:"quantityPurchased"` + + TotalCost string `json:"totalCost"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata + + retval.Typename = v.Typename + retval.ProductName = v.AmazonActivityMetadata.ProductName + retval.Subject = v.AmazonActivityMetadata.Subject + retval.Date = v.AmazonActivityMetadata.Date + retval.QuantityPurchased = v.AmazonActivityMetadata.QuantityPurchased + retval.TotalCost = v.AmazonActivityMetadata.TotalCost + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { + Typename string `json:"__typename"` + BookingActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { + return v.BookingActivityMetadata.Subject +} + +// GetBookingID returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookingID() string { + return v.BookingActivityMetadata.BookingID +} + +// GetPrice returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetPrice() string { + return v.BookingActivityMetadata.Price +} + +// GetBookings returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { + return v.BookingActivityMetadata.Bookings +} + +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.BookingActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` + + BookingID string `json:"bookingID"` + + Price string `json:"price"` + + Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.BookingActivityMetadata.Subject + retval.BookingID = v.BookingActivityMetadata.BookingID + retval.Price = v.BookingActivityMetadata.Price + retval.Bookings = v.BookingActivityMetadata.Bookings + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata struct { + Typename string `json:"__typename"` + InstacartActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { + return v.InstacartActivityMetadata.Subject +} + +// GetRetailer returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetRetailer() string { + return v.InstacartActivityMetadata.Retailer +} + +// GetTotalOrderAmountSpent returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { + return v.InstacartActivityMetadata.TotalOrderAmountSpent +} + +// GetDateOrdered returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateOrdered +} + +// GetDateDelivered returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateDelivered +} + +// GetStatusString returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetStatusString() string { + return v.InstacartActivityMetadata.StatusString +} + +// GetItems returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.InstacartActivityMetadata.Items +} + +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.InstacartActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` + + Retailer string `json:"retailer"` + + TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` + + DateOrdered graphqlTypes.Date `json:"dateOrdered"` + + DateDelivered graphqlTypes.Date `json:"dateDelivered"` + + StatusString string `json:"statusString"` + + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.InstacartActivityMetadata.Subject + retval.Retailer = v.InstacartActivityMetadata.Retailer + retval.TotalOrderAmountSpent = v.InstacartActivityMetadata.TotalOrderAmountSpent + retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered + retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered + retval.StatusString = v.InstacartActivityMetadata.StatusString + retval.Items = v.InstacartActivityMetadata.Items + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata includes the requested fields of the GraphQL type NetflixActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata struct { + Typename string `json:"__typename"` + NetflixActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetTitle returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetTitle() string { + return v.NetflixActivityMetadata.Title +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { + return v.NetflixActivityMetadata.Subject +} + +// GetDate returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetDate() graphqlTypes.Date { + return v.NetflixActivityMetadata.Date +} + +// GetLastPlayedAt returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { + return v.NetflixActivityMetadata.LastPlayedAt +} + +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.NetflixActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.NetflixActivityMetadata.Title + retval.Subject = v.NetflixActivityMetadata.Subject + retval.Date = v.NetflixActivityMetadata.Date + retval.LastPlayedAt = v.NetflixActivityMetadata.LastPlayedAt + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata includes the requested fields of the GraphQL type PlaystationActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata struct { + Typename string `json:"__typename"` + PlaystationActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetTitle returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetTitle() string { + return v.PlaystationActivityMetadata.Title +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { + return v.PlaystationActivityMetadata.Subject +} + +// GetLastPlayedAt returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { + return v.PlaystationActivityMetadata.LastPlayedAt +} + +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.PlaystationActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` + + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.PlaystationActivityMetadata.Title + retval.Subject = v.PlaystationActivityMetadata.Subject + retval.LastPlayedAt = v.PlaystationActivityMetadata.LastPlayedAt + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataUberActivityMetadata includes the requested fields of the GraphQL type UberActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataUberActivityMetadata struct { + Typename string `json:"__typename"` + UberActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { + return v.UberActivityMetadata.Subject +} + +// GetBeginTripTime returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetBeginTripTime() time.Time { + return v.UberActivityMetadata.BeginTripTime +} + +// GetDropoffTime returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetDropoffTime() time.Time { + return v.UberActivityMetadata.DropoffTime +} + +// GetCost returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Cost, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetCost() string { + return v.UberActivityMetadata.Cost +} + +// GetCity returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.City, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetCity() string { + return v.UberActivityMetadata.City +} + +// GetDistance returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Distance, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetDistance() string { + return v.UberActivityMetadata.Distance +} + +// GetStatus returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetStatus() TripStatus { + return v.UberActivityMetadata.Status +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataUberActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UberActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` + + BeginTripTime time.Time `json:"beginTripTime"` + + DropoffTime time.Time `json:"dropoffTime"` + + Cost string `json:"cost"` + + City string `json:"city"` + + Distance string `json:"distance"` + + Status TripStatus `json:"status"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.UberActivityMetadata.Subject + retval.BeginTripTime = v.UberActivityMetadata.BeginTripTime + retval.DropoffTime = v.UberActivityMetadata.DropoffTime + retval.Cost = v.UberActivityMetadata.Cost + retval.City = v.UberActivityMetadata.City + retval.Distance = v.UberActivityMetadata.Distance + retval.Status = v.UberActivityMetadata.Status + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { + Typename string `json:"__typename"` + UberEatsActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { + return v.UberEatsActivityMetadata.Subject +} + +// GetDate returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { + return v.UberEatsActivityMetadata.Date +} + +// GetRestaurant returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { + return v.UberEatsActivityMetadata.Restaurant +} + +// GetCurrency returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetCurrency() string { + return v.UberEatsActivityMetadata.Currency +} + +// GetTotalPrice returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { + return v.UberEatsActivityMetadata.TotalPrice +} + +// GetUberEatsActivityMetadataStatus returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus +} + +// GetUberEatsActivityMetadataItems returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataItems +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UberEatsActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + Restaurant string `json:"restaurant"` + + Currency string `json:"currency"` + + TotalPrice float64 `json:"totalPrice"` + + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` + + UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.UberEatsActivityMetadata.Subject + retval.Date = v.UberEatsActivityMetadata.Date + retval.Restaurant = v.UberEatsActivityMetadata.Restaurant + retval.Currency = v.UberEatsActivityMetadata.Currency + retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice + retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus + retval.UberEatsActivityMetadataItems = v.UberEatsActivityMetadata.UberEatsActivityMetadataItems + return &retval, nil +} + +// GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. +type GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata struct { + Typename string `json:"__typename"` + YoutubeActivityMetadata `json:"-"` +} + +// GetTypename returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetTypename() string { + return v.Typename +} + +// GetTitle returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetTitle() string { + return v.YoutubeActivityMetadata.Title +} + +// GetSubject returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { + return v.YoutubeActivityMetadata.Subject +} + +// GetDate returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetDate() graphqlTypes.Date { + return v.YoutubeActivityMetadata.Date +} + +// GetPercentageWatched returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetPercentageWatched() int { + return v.YoutubeActivityMetadata.PercentageWatched +} + +// GetContentType returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetContentType() ContentType { + return v.YoutubeActivityMetadata.ContentType +} + +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.YoutubeActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + PercentageWatched int `json:"percentageWatched"` + + ContentType ContentType `json:"contentType"` +} + +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata, error) { + var retval __premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.YoutubeActivityMetadata.Title + retval.Subject = v.YoutubeActivityMetadata.Subject + retval.Date = v.YoutubeActivityMetadata.Date + retval.PercentageWatched = v.YoutubeActivityMetadata.PercentageWatched + retval.ContentType = v.YoutubeActivityMetadata.ContentType + return &retval, nil +} + +// GetAppByPublicKeyApplication includes the requested fields of the GraphQL type Application. +type GetAppByPublicKeyApplication struct { + AppName string `json:"appName"` + PublicKey string `json:"publicKey"` + IconURL string `json:"iconURL"` + GandalfID graphqlTypes.Int64 `json:"gandalfID"` + AppRegistrar string `json:"appRegistrar"` +} + +// GetAppName returns GetAppByPublicKeyApplication.AppName, and is useful for accessing the field via an interface. +func (v *GetAppByPublicKeyApplication) GetAppName() string { return v.AppName } + +// GetPublicKey returns GetAppByPublicKeyApplication.PublicKey, and is useful for accessing the field via an interface. +func (v *GetAppByPublicKeyApplication) GetPublicKey() string { return v.PublicKey } + +// GetIconURL returns GetAppByPublicKeyApplication.IconURL, and is useful for accessing the field via an interface. +func (v *GetAppByPublicKeyApplication) GetIconURL() string { return v.IconURL } + +// GetGandalfID returns GetAppByPublicKeyApplication.GandalfID, and is useful for accessing the field via an interface. +func (v *GetAppByPublicKeyApplication) GetGandalfID() graphqlTypes.Int64 { return v.GandalfID } + +// GetAppRegistrar returns GetAppByPublicKeyApplication.AppRegistrar, and is useful for accessing the field via an interface. +func (v *GetAppByPublicKeyApplication) GetAppRegistrar() string { return v.AppRegistrar } + +// GetTraitsTrait includes the requested fields of the GraphQL type Trait. +type GetTraitsTrait struct { + Id uuid.UUID `json:"id"` + Source Source `json:"source"` + Label TraitLabel `json:"label"` + Value string `json:"value"` + Timestamp time.Time `json:"timestamp"` +} + +// GetId returns GetTraitsTrait.Id, and is useful for accessing the field via an interface. +func (v *GetTraitsTrait) GetId() uuid.UUID { return v.Id } + +// GetSource returns GetTraitsTrait.Source, and is useful for accessing the field via an interface. +func (v *GetTraitsTrait) GetSource() Source { return v.Source } + +// GetLabel returns GetTraitsTrait.Label, and is useful for accessing the field via an interface. +func (v *GetTraitsTrait) GetLabel() TraitLabel { return v.Label } + +// GetValue returns GetTraitsTrait.Value, and is useful for accessing the field via an interface. +func (v *GetTraitsTrait) GetValue() string { return v.Value } + +// GetTimestamp returns GetTraitsTrait.Timestamp, and is useful for accessing the field via an interface. +func (v *GetTraitsTrait) GetTimestamp() time.Time { return v.Timestamp } + +type IdentifierType string + +const ( + IdentifierTypeImdb IdentifierType = "IMDB" + IdentifierTypeMoby IdentifierType = "MOBY" + IdentifierTypeRawg IdentifierType = "RAWG" + IdentifierTypeIgdb IdentifierType = "IGDB" + IdentifierTypeAsin IdentifierType = "ASIN" + IdentifierTypePlaystation IdentifierType = "PLAYSTATION" + IdentifierTypeYoutube IdentifierType = "YOUTUBE" + IdentifierTypeTvdb IdentifierType = "TVDB" + IdentifierTypeTvmaze IdentifierType = "TVMAZE" + IdentifierTypeUber IdentifierType = "UBER" + IdentifierTypeBooking IdentifierType = "BOOKING" + IdentifierTypeInstacart IdentifierType = "INSTACART" + IdentifierTypeUbereats IdentifierType = "UBEREATS" +) + +// InstacartActivityMetadata includes the GraphQL fields of InstacartActivityMetadata requested by the fragment InstacartActivityMetadata. +type InstacartActivityMetadata struct { + Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` + Retailer string `json:"retailer"` + TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` + DateOrdered graphqlTypes.Date `json:"dateOrdered"` + DateDelivered graphqlTypes.Date `json:"dateDelivered"` + StatusString string `json:"statusString"` + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` +} + +// GetSubject returns InstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetRetailer returns InstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetRetailer() string { return v.Retailer } + +// GetTotalOrderAmountSpent returns InstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetTotalOrderAmountSpent() string { return v.TotalOrderAmountSpent } + +// GetDateOrdered returns InstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { return v.DateOrdered } + +// GetDateDelivered returns InstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { return v.DateDelivered } + +// GetStatusString returns InstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetStatusString() string { return v.StatusString } + +// GetItems returns InstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.Items +} + +// InstacartActivityMetadataItemsInstacartOrderItem includes the requested fields of the GraphQL type InstacartOrderItem. +type InstacartActivityMetadataItemsInstacartOrderItem struct { + ItemID string `json:"itemID"` + ProductName string `json:"productName"` + UnitPrice string `json:"unitPrice"` + Status InstacartItemStatus `json:"status"` + QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` +} + +// GetItemID returns InstacartActivityMetadataItemsInstacartOrderItem.ItemID, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetItemID() string { return v.ItemID } + +// GetProductName returns InstacartActivityMetadataItemsInstacartOrderItem.ProductName, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetProductName() string { + return v.ProductName +} + +// GetUnitPrice returns InstacartActivityMetadataItemsInstacartOrderItem.UnitPrice, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetUnitPrice() string { return v.UnitPrice } + +// GetStatus returns InstacartActivityMetadataItemsInstacartOrderItem.Status, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetStatus() InstacartItemStatus { + return v.Status +} + +// GetQuantityPurchased returns InstacartActivityMetadataItemsInstacartOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { + return v.QuantityPurchased +} + +// InstacartActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type InstacartActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns InstacartActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns InstacartActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *InstacartActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +type InstacartItemStatus string + +const ( + InstacartItemStatusFound InstacartItemStatus = "FOUND" + InstacartItemStatusReplaced InstacartItemStatus = "REPLACED" + InstacartItemStatusTorefund InstacartItemStatus = "TOREFUND" +) + +// LookupActivity includes the requested fields of the GraphQL type Activity. +type LookupActivity struct { + Id string `json:"id"` + Metadata LookupActivityMetadata `json:"-"` +} + +// GetId returns LookupActivity.Id, and is useful for accessing the field via an interface. +func (v *LookupActivity) GetId() string { return v.Id } + +// GetMetadata returns LookupActivity.Metadata, and is useful for accessing the field via an interface. +func (v *LookupActivity) GetMetadata() LookupActivityMetadata { return v.Metadata } + +func (v *LookupActivity) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivity + Metadata json.RawMessage `json:"metadata"` + graphql.NoUnmarshalJSON + } + firstPass.LookupActivity = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + { + dst := &v.Metadata + src := firstPass.Metadata + if len(src) != 0 && string(src) != "null" { + err = __unmarshalLookupActivityMetadata( + src, dst) + if err != nil { + return fmt.Errorf( + "unable to unmarshal LookupActivity.Metadata: %w", err) + } + } + } + return nil +} + +type __premarshalLookupActivity struct { + Id string `json:"id"` + + Metadata json.RawMessage `json:"metadata"` +} + +func (v *LookupActivity) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivity) __premarshalJSON() (*__premarshalLookupActivity, error) { + var retval __premarshalLookupActivity + + retval.Id = v.Id + { + + dst := &retval.Metadata + src := v.Metadata + var err error + *dst, err = __marshalLookupActivityMetadata( + &src) + if err != nil { + return nil, fmt.Errorf( + "unable to marshal LookupActivity.Metadata: %w", err) + } + } + return &retval, nil +} + +// LookupActivityMetadata includes the requested fields of the GraphQL interface ActivityMetadata. +// +// LookupActivityMetadata is implemented by the following types: +// LookupActivityMetadataAmazonActivityMetadata +// LookupActivityMetadataBookingActivityMetadata +// LookupActivityMetadataInstacartActivityMetadata +// LookupActivityMetadataNetflixActivityMetadata +// LookupActivityMetadataPlaystationActivityMetadata +// LookupActivityMetadataUberActivityMetadata +// LookupActivityMetadataUberEatsActivityMetadata +// LookupActivityMetadataYoutubeActivityMetadata +type LookupActivityMetadata interface { + implementsGraphQLInterfaceLookupActivityMetadata() + // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). + GetTypename() string +} + +func (v *LookupActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataPlaystationActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} +func (v *LookupActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { +} + +func __unmarshalLookupActivityMetadata(b []byte, v *LookupActivityMetadata) error { + if string(b) == "null" { + return nil + } + + var tn struct { + TypeName string `json:"__typename"` + } + err := json.Unmarshal(b, &tn) + if err != nil { + return err + } + + switch tn.TypeName { + case "AmazonActivityMetadata": + *v = new(LookupActivityMetadataAmazonActivityMetadata) + return json.Unmarshal(b, *v) + case "BookingActivityMetadata": + *v = new(LookupActivityMetadataBookingActivityMetadata) + return json.Unmarshal(b, *v) + case "InstacartActivityMetadata": + *v = new(LookupActivityMetadataInstacartActivityMetadata) + return json.Unmarshal(b, *v) + case "NetflixActivityMetadata": + *v = new(LookupActivityMetadataNetflixActivityMetadata) + return json.Unmarshal(b, *v) + case "PlaystationActivityMetadata": + *v = new(LookupActivityMetadataPlaystationActivityMetadata) + return json.Unmarshal(b, *v) + case "UberActivityMetadata": + *v = new(LookupActivityMetadataUberActivityMetadata) + return json.Unmarshal(b, *v) + case "UberEatsActivityMetadata": + *v = new(LookupActivityMetadataUberEatsActivityMetadata) + return json.Unmarshal(b, *v) + case "YoutubeActivityMetadata": + *v = new(LookupActivityMetadataYoutubeActivityMetadata) + return json.Unmarshal(b, *v) + case "": + return fmt.Errorf( + "response was missing ActivityMetadata.__typename") + default: + return fmt.Errorf( + `unexpected concrete type for LookupActivityMetadata: "%v"`, tn.TypeName) + } +} + +func __marshalLookupActivityMetadata(v *LookupActivityMetadata) ([]byte, error) { + + var typename string + switch v := (*v).(type) { + case *LookupActivityMetadataAmazonActivityMetadata: + typename = "AmazonActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataAmazonActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataBookingActivityMetadata: + typename = "BookingActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataBookingActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataInstacartActivityMetadata: + typename = "InstacartActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataInstacartActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataNetflixActivityMetadata: + typename = "NetflixActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataNetflixActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataPlaystationActivityMetadata: + typename = "PlaystationActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataPlaystationActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataUberActivityMetadata: + typename = "UberActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataUberActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataUberEatsActivityMetadata: + typename = "UberEatsActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataUberEatsActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case *LookupActivityMetadataYoutubeActivityMetadata: + typename = "YoutubeActivityMetadata" + + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + result := struct { + TypeName string `json:"__typename"` + *__premarshalLookupActivityMetadataYoutubeActivityMetadata + }{typename, premarshaled} + return json.Marshal(result) + case nil: + return []byte("null"), nil + default: + return nil, fmt.Errorf( + `unexpected concrete type for LookupActivityMetadata: "%T"`, v) + } +} + +// LookupActivityMetadataAmazonActivityMetadata includes the requested fields of the GraphQL type AmazonActivityMetadata. +type LookupActivityMetadataAmazonActivityMetadata struct { + Typename string `json:"__typename"` + AmazonActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataAmazonActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetTypename() string { return v.Typename } + +// GetProductName returns LookupActivityMetadataAmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetProductName() string { + return v.AmazonActivityMetadata.ProductName +} + +// GetSubject returns LookupActivityMetadataAmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { + return v.AmazonActivityMetadata.Subject +} + +// GetDate returns LookupActivityMetadataAmazonActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetDate() graphqlTypes.Date { + return v.AmazonActivityMetadata.Date +} + +// GetQuantityPurchased returns LookupActivityMetadataAmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetQuantityPurchased() int { + return v.AmazonActivityMetadata.QuantityPurchased +} + +// GetTotalCost returns LookupActivityMetadataAmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataAmazonActivityMetadata) GetTotalCost() string { + return v.AmazonActivityMetadata.TotalCost +} + +func (v *LookupActivityMetadataAmazonActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataAmazonActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataAmazonActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.AmazonActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataAmazonActivityMetadata struct { + Typename string `json:"__typename"` + + ProductName string `json:"productName"` + + Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + QuantityPurchased int `json:"quantityPurchased"` + + TotalCost string `json:"totalCost"` +} + +func (v *LookupActivityMetadataAmazonActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataAmazonActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataAmazonActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataAmazonActivityMetadata + + retval.Typename = v.Typename + retval.ProductName = v.AmazonActivityMetadata.ProductName + retval.Subject = v.AmazonActivityMetadata.Subject + retval.Date = v.AmazonActivityMetadata.Date + retval.QuantityPurchased = v.AmazonActivityMetadata.QuantityPurchased + retval.TotalCost = v.AmazonActivityMetadata.TotalCost + return &retval, nil +} + +// LookupActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. +type LookupActivityMetadataBookingActivityMetadata struct { + Typename string `json:"__typename"` + BookingActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataBookingActivityMetadata) GetTypename() string { return v.Typename } + +// GetSubject returns LookupActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { + return v.BookingActivityMetadata.Subject +} + +// GetBookingID returns LookupActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataBookingActivityMetadata) GetBookingID() string { + return v.BookingActivityMetadata.BookingID +} + +// GetPrice returns LookupActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataBookingActivityMetadata) GetPrice() string { + return v.BookingActivityMetadata.Price +} + +// GetBookings returns LookupActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { + return v.BookingActivityMetadata.Bookings +} + +func (v *LookupActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataBookingActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataBookingActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.BookingActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataBookingActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` + + BookingID string `json:"bookingID"` + + Price string `json:"price"` + + Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` +} + +func (v *LookupActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataBookingActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataBookingActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.BookingActivityMetadata.Subject + retval.BookingID = v.BookingActivityMetadata.BookingID + retval.Price = v.BookingActivityMetadata.Price + retval.Bookings = v.BookingActivityMetadata.Bookings + return &retval, nil +} + +// LookupActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. +type LookupActivityMetadataInstacartActivityMetadata struct { + Typename string `json:"__typename"` + InstacartActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetTypename() string { return v.Typename } + +// GetSubject returns LookupActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { + return v.InstacartActivityMetadata.Subject +} + +// GetRetailer returns LookupActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetRetailer() string { + return v.InstacartActivityMetadata.Retailer +} + +// GetTotalOrderAmountSpent returns LookupActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { + return v.InstacartActivityMetadata.TotalOrderAmountSpent +} + +// GetDateOrdered returns LookupActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateOrdered +} + +// GetDateDelivered returns LookupActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { + return v.InstacartActivityMetadata.DateDelivered +} + +// GetStatusString returns LookupActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetStatusString() string { + return v.InstacartActivityMetadata.StatusString +} + +// GetItems returns LookupActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { + return v.InstacartActivityMetadata.Items +} + +func (v *LookupActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataInstacartActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataInstacartActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.InstacartActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataInstacartActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` + + Retailer string `json:"retailer"` + + TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` + + DateOrdered graphqlTypes.Date `json:"dateOrdered"` + + DateDelivered graphqlTypes.Date `json:"dateDelivered"` + + StatusString string `json:"statusString"` + + Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` +} + +func (v *LookupActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataInstacartActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataInstacartActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.InstacartActivityMetadata.Subject + retval.Retailer = v.InstacartActivityMetadata.Retailer + retval.TotalOrderAmountSpent = v.InstacartActivityMetadata.TotalOrderAmountSpent + retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered + retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered + retval.StatusString = v.InstacartActivityMetadata.StatusString + retval.Items = v.InstacartActivityMetadata.Items + return &retval, nil +} + +// LookupActivityMetadataNetflixActivityMetadata includes the requested fields of the GraphQL type NetflixActivityMetadata. +type LookupActivityMetadataNetflixActivityMetadata struct { + Typename string `json:"__typename"` + NetflixActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataNetflixActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataNetflixActivityMetadata) GetTypename() string { return v.Typename } + +// GetTitle returns LookupActivityMetadataNetflixActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataNetflixActivityMetadata) GetTitle() string { + return v.NetflixActivityMetadata.Title +} + +// GetSubject returns LookupActivityMetadataNetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataNetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { + return v.NetflixActivityMetadata.Subject +} + +// GetDate returns LookupActivityMetadataNetflixActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataNetflixActivityMetadata) GetDate() graphqlTypes.Date { + return v.NetflixActivityMetadata.Date +} + +// GetLastPlayedAt returns LookupActivityMetadataNetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataNetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { + return v.NetflixActivityMetadata.LastPlayedAt +} + +func (v *LookupActivityMetadataNetflixActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataNetflixActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataNetflixActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.NetflixActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataNetflixActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +func (v *LookupActivityMetadataNetflixActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataNetflixActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataNetflixActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataNetflixActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.NetflixActivityMetadata.Title + retval.Subject = v.NetflixActivityMetadata.Subject + retval.Date = v.NetflixActivityMetadata.Date + retval.LastPlayedAt = v.NetflixActivityMetadata.LastPlayedAt + return &retval, nil +} + +// LookupActivityMetadataPlaystationActivityMetadata includes the requested fields of the GraphQL type PlaystationActivityMetadata. +type LookupActivityMetadataPlaystationActivityMetadata struct { + Typename string `json:"__typename"` + PlaystationActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataPlaystationActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataPlaystationActivityMetadata) GetTypename() string { return v.Typename } + +// GetTitle returns LookupActivityMetadataPlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataPlaystationActivityMetadata) GetTitle() string { + return v.PlaystationActivityMetadata.Title +} + +// GetSubject returns LookupActivityMetadataPlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataPlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { + return v.PlaystationActivityMetadata.Subject +} + +// GetLastPlayedAt returns LookupActivityMetadataPlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataPlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { + return v.PlaystationActivityMetadata.LastPlayedAt +} + +func (v *LookupActivityMetadataPlaystationActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataPlaystationActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataPlaystationActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.PlaystationActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataPlaystationActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` + + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +func (v *LookupActivityMetadataPlaystationActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataPlaystationActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataPlaystationActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataPlaystationActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.PlaystationActivityMetadata.Title + retval.Subject = v.PlaystationActivityMetadata.Subject + retval.LastPlayedAt = v.PlaystationActivityMetadata.LastPlayedAt + return &retval, nil +} + +// LookupActivityMetadataUberActivityMetadata includes the requested fields of the GraphQL type UberActivityMetadata. +type LookupActivityMetadataUberActivityMetadata struct { + Typename string `json:"__typename"` + UberActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataUberActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetTypename() string { return v.Typename } + +// GetSubject returns LookupActivityMetadataUberActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { + return v.UberActivityMetadata.Subject +} + +// GetBeginTripTime returns LookupActivityMetadataUberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetBeginTripTime() time.Time { + return v.UberActivityMetadata.BeginTripTime +} + +// GetDropoffTime returns LookupActivityMetadataUberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetDropoffTime() time.Time { + return v.UberActivityMetadata.DropoffTime +} + +// GetCost returns LookupActivityMetadataUberActivityMetadata.Cost, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetCost() string { + return v.UberActivityMetadata.Cost +} + +// GetCity returns LookupActivityMetadataUberActivityMetadata.City, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetCity() string { + return v.UberActivityMetadata.City +} + +// GetDistance returns LookupActivityMetadataUberActivityMetadata.Distance, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetDistance() string { + return v.UberActivityMetadata.Distance +} + +// GetStatus returns LookupActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberActivityMetadata) GetStatus() TripStatus { + return v.UberActivityMetadata.Status +} + +func (v *LookupActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataUberActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataUberActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UberActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataUberActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` + + BeginTripTime time.Time `json:"beginTripTime"` + + DropoffTime time.Time `json:"dropoffTime"` + + Cost string `json:"cost"` + + City string `json:"city"` + + Distance string `json:"distance"` + + Status TripStatus `json:"status"` +} + +func (v *LookupActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataUberActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataUberActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataUberActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.UberActivityMetadata.Subject + retval.BeginTripTime = v.UberActivityMetadata.BeginTripTime + retval.DropoffTime = v.UberActivityMetadata.DropoffTime + retval.Cost = v.UberActivityMetadata.Cost + retval.City = v.UberActivityMetadata.City + retval.Distance = v.UberActivityMetadata.Distance + retval.Status = v.UberActivityMetadata.Status + return &retval, nil +} + +// LookupActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. +type LookupActivityMetadataUberEatsActivityMetadata struct { + Typename string `json:"__typename"` + UberEatsActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTypename() string { return v.Typename } + +// GetSubject returns LookupActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { + return v.UberEatsActivityMetadata.Subject +} + +// GetDate returns LookupActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { + return v.UberEatsActivityMetadata.Date +} + +// GetRestaurant returns LookupActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { + return v.UberEatsActivityMetadata.Restaurant +} + +// GetCurrency returns LookupActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetCurrency() string { + return v.UberEatsActivityMetadata.Currency +} + +// GetTotalPrice returns LookupActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { + return v.UberEatsActivityMetadata.TotalPrice +} + +// GetUberEatsActivityMetadataStatus returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus +} + +// GetUberEatsActivityMetadataItems returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { + return v.UberEatsActivityMetadata.UberEatsActivityMetadataItems +} + +func (v *LookupActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataUberEatsActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataUberEatsActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.UberEatsActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataUberEatsActivityMetadata struct { + Typename string `json:"__typename"` + + Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + Restaurant string `json:"restaurant"` + + Currency string `json:"currency"` + + TotalPrice float64 `json:"totalPrice"` + + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` + + UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` +} + +func (v *LookupActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataUberEatsActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataUberEatsActivityMetadata + + retval.Typename = v.Typename + retval.Subject = v.UberEatsActivityMetadata.Subject + retval.Date = v.UberEatsActivityMetadata.Date + retval.Restaurant = v.UberEatsActivityMetadata.Restaurant + retval.Currency = v.UberEatsActivityMetadata.Currency + retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice + retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus + retval.UberEatsActivityMetadataItems = v.UberEatsActivityMetadata.UberEatsActivityMetadataItems + return &retval, nil +} + +// LookupActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. +type LookupActivityMetadataYoutubeActivityMetadata struct { + Typename string `json:"__typename"` + YoutubeActivityMetadata `json:"-"` +} + +// GetTypename returns LookupActivityMetadataYoutubeActivityMetadata.Typename, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetTypename() string { return v.Typename } + +// GetTitle returns LookupActivityMetadataYoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetTitle() string { + return v.YoutubeActivityMetadata.Title +} + +// GetSubject returns LookupActivityMetadataYoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { + return v.YoutubeActivityMetadata.Subject +} + +// GetDate returns LookupActivityMetadataYoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetDate() graphqlTypes.Date { + return v.YoutubeActivityMetadata.Date +} + +// GetPercentageWatched returns LookupActivityMetadataYoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetPercentageWatched() int { + return v.YoutubeActivityMetadata.PercentageWatched +} + +// GetContentType returns LookupActivityMetadataYoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. +func (v *LookupActivityMetadataYoutubeActivityMetadata) GetContentType() ContentType { + return v.YoutubeActivityMetadata.ContentType +} + +func (v *LookupActivityMetadataYoutubeActivityMetadata) UnmarshalJSON(b []byte) error { + + if string(b) == "null" { + return nil + } + + var firstPass struct { + *LookupActivityMetadataYoutubeActivityMetadata + graphql.NoUnmarshalJSON + } + firstPass.LookupActivityMetadataYoutubeActivityMetadata = v + + err := json.Unmarshal(b, &firstPass) + if err != nil { + return err + } + + err = json.Unmarshal( + b, &v.YoutubeActivityMetadata) + if err != nil { + return err + } + return nil +} + +type __premarshalLookupActivityMetadataYoutubeActivityMetadata struct { + Typename string `json:"__typename"` + + Title string `json:"title"` + + Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` + + Date graphqlTypes.Date `json:"date"` + + PercentageWatched int `json:"percentageWatched"` + + ContentType ContentType `json:"contentType"` +} + +func (v *LookupActivityMetadataYoutubeActivityMetadata) MarshalJSON() ([]byte, error) { + premarshaled, err := v.__premarshalJSON() + if err != nil { + return nil, err + } + return json.Marshal(premarshaled) +} + +func (v *LookupActivityMetadataYoutubeActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataYoutubeActivityMetadata, error) { + var retval __premarshalLookupActivityMetadataYoutubeActivityMetadata + + retval.Typename = v.Typename + retval.Title = v.YoutubeActivityMetadata.Title + retval.Subject = v.YoutubeActivityMetadata.Subject + retval.Date = v.YoutubeActivityMetadata.Date + retval.PercentageWatched = v.YoutubeActivityMetadata.PercentageWatched + retval.ContentType = v.YoutubeActivityMetadata.ContentType + return &retval, nil +} + +// LookupTrait includes the requested fields of the GraphQL type Trait. +type LookupTrait struct { + Id uuid.UUID `json:"id"` + Source Source `json:"source"` + Label TraitLabel `json:"label"` + Value string `json:"value"` + Timestamp time.Time `json:"timestamp"` +} + +// GetId returns LookupTrait.Id, and is useful for accessing the field via an interface. +func (v *LookupTrait) GetId() uuid.UUID { return v.Id } + +// GetSource returns LookupTrait.Source, and is useful for accessing the field via an interface. +func (v *LookupTrait) GetSource() Source { return v.Source } + +// GetLabel returns LookupTrait.Label, and is useful for accessing the field via an interface. +func (v *LookupTrait) GetLabel() TraitLabel { return v.Label } + +// GetValue returns LookupTrait.Value, and is useful for accessing the field via an interface. +func (v *LookupTrait) GetValue() string { return v.Value } + +// GetTimestamp returns LookupTrait.Timestamp, and is useful for accessing the field via an interface. +func (v *LookupTrait) GetTimestamp() time.Time { return v.Timestamp } + +// NetflixActivityMetadata includes the GraphQL fields of NetflixActivityMetadata requested by the fragment NetflixActivityMetadata. +type NetflixActivityMetadata struct { + Title string `json:"title"` + Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` + Date graphqlTypes.Date `json:"date"` + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +// GetTitle returns NetflixActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadata) GetTitle() string { return v.Title } + +// GetSubject returns NetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetDate returns NetflixActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } + +// GetLastPlayedAt returns NetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { return v.LastPlayedAt } + +// NetflixActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type NetflixActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns NetflixActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns NetflixActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *NetflixActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +// PlaystationActivityMetadata includes the GraphQL fields of PlaystationActivityMetadata requested by the fragment PlaystationActivityMetadata. +type PlaystationActivityMetadata struct { + Title string `json:"title"` + Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` + LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` +} + +// GetTitle returns PlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *PlaystationActivityMetadata) GetTitle() string { return v.Title } + +// GetSubject returns PlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *PlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetLastPlayedAt returns PlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. +func (v *PlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { return v.LastPlayedAt } + +// PlaystationActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type PlaystationActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns PlaystationActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *PlaystationActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns PlaystationActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *PlaystationActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +type Source string + +const ( + SourceNetflix Source = "NETFLIX" + SourcePlaystation Source = "PLAYSTATION" + SourceYoutube Source = "YOUTUBE" + SourceAmazon Source = "AMAZON" + SourceUber Source = "UBER" + SourceBooking Source = "BOOKING" + SourceInstacart Source = "INSTACART" + SourceInstagram Source = "INSTAGRAM" + SourceX Source = "X" + SourceUbereats Source = "UBEREATS" + SourceGandalf Source = "GANDALF" +) + +type TraitLabel string + +const ( + TraitLabelPrimeSubscriber TraitLabel = "PRIME_SUBSCRIBER" + TraitLabelRating TraitLabel = "RATING" + TraitLabelTripCount TraitLabel = "TRIP_COUNT" + TraitLabelAccountCreatedOn TraitLabel = "ACCOUNT_CREATED_ON" + TraitLabelPlan TraitLabel = "PLAN" + TraitLabelGeniusLevel TraitLabel = "GENIUS_LEVEL" + TraitLabelFollowerCount TraitLabel = "FOLLOWER_COUNT" + TraitLabelFollowingCount TraitLabel = "FOLLOWING_COUNT" + TraitLabelUsername TraitLabel = "USERNAME" + TraitLabelPostCount TraitLabel = "POST_COUNT" + TraitLabelEmail TraitLabel = "EMAIL" + TraitLabelOrderCount TraitLabel = "ORDER_COUNT" +) + +type TripStatus string + +const ( + TripStatusCanceled TripStatus = "CANCELED" + TripStatusCompleted TripStatus = "COMPLETED" + TripStatusUnfulfilled TripStatus = "UNFULFILLED" +) + +// UberActivityMetadata includes the GraphQL fields of UberActivityMetadata requested by the fragment UberActivityMetadata. +type UberActivityMetadata struct { + Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` + BeginTripTime time.Time `json:"beginTripTime"` + DropoffTime time.Time `json:"dropoffTime"` + Cost string `json:"cost"` + City string `json:"city"` + Distance string `json:"distance"` + Status TripStatus `json:"status"` +} + +// GetSubject returns UberActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { return v.Subject } + +// GetBeginTripTime returns UberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetBeginTripTime() time.Time { return v.BeginTripTime } + +// GetDropoffTime returns UberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetDropoffTime() time.Time { return v.DropoffTime } + +// GetCost returns UberActivityMetadata.Cost, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetCost() string { return v.Cost } + +// GetCity returns UberActivityMetadata.City, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetCity() string { return v.City } + +// GetDistance returns UberActivityMetadata.Distance, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetDistance() string { return v.Distance } + +// GetStatus returns UberActivityMetadata.Status, and is useful for accessing the field via an interface. +func (v *UberActivityMetadata) GetStatus() TripStatus { return v.Status } + +// UberActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type UberActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns UberActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *UberActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns UberActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *UberActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +// UberEatsActivityMetadata includes the GraphQL fields of UberEatsActivityMetadata requested by the fragment UberEatsActivityMetadata. +type UberEatsActivityMetadata struct { + Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` + Date graphqlTypes.Date `json:"date"` + Restaurant string `json:"restaurant"` + Currency string `json:"currency"` + TotalPrice float64 `json:"totalPrice"` + UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` + UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` +} + +// GetSubject returns UberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetDate returns UberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } + +// GetRestaurant returns UberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetRestaurant() string { return v.Restaurant } + +// GetCurrency returns UberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetCurrency() string { return v.Currency } + +// GetTotalPrice returns UberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetTotalPrice() float64 { return v.TotalPrice } + +// GetUberEatsActivityMetadataStatus returns UberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { + return v.UberEatsActivityMetadataStatus +} + +// GetUberEatsActivityMetadataItems returns UberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { + return v.UberEatsActivityMetadataItems +} + +// UberEatsActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type UberEatsActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns UberEatsActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns UberEatsActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +// UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem includes the requested fields of the GraphQL type UberEatsOrderItem. +type UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem struct { + Name string `json:"name"` + Price string `json:"price"` + QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` + Customizations []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations `json:"customizations"` +} + +// GetName returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Name, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetName() string { + return v.Name +} + +// GetPrice returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Price, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetPrice() string { + return v.Price +} + +// GetQuantityPurchased returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { + return v.QuantityPurchased +} + +// GetCustomizations returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Customizations, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetCustomizations() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations { + return v.Customizations +} + +// UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations includes the requested fields of the GraphQL type UberEatsOrderItemCustomizations. +type UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations struct { + Customization string `json:"customization"` + Value string `json:"value"` + Quantity graphqlTypes.Int64 `json:"quantity"` +} + +// GetCustomization returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Customization, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetCustomization() string { + return v.Customization +} + +// GetValue returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Value, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetValue() string { + return v.Value +} + +// GetQuantity returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Quantity, and is useful for accessing the field via an interface. +func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetQuantity() graphqlTypes.Int64 { + return v.Quantity +} + +type UberEatsOrderStatus string + +const ( + UberEatsOrderStatusSuccess UberEatsOrderStatus = "SUCCESS" + UberEatsOrderStatusEaterCancelled UberEatsOrderStatus = "EATER_CANCELLED" + UberEatsOrderStatusRestaurantCancelled UberEatsOrderStatus = "RESTAURANT_CANCELLED" + UberEatsOrderStatusRestaurantUnfulfilled UberEatsOrderStatus = "RESTAURANT_UNFULFILLED" + UberEatsOrderStatusUnknown UberEatsOrderStatus = "UNKNOWN" +) + +// YoutubeActivityMetadata includes the GraphQL fields of YoutubeActivityMetadata requested by the fragment YoutubeActivityMetadata. +type YoutubeActivityMetadata struct { + Title string `json:"title"` + Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` + Date graphqlTypes.Date `json:"date"` + PercentageWatched int `json:"percentageWatched"` + ContentType ContentType `json:"contentType"` +} + +// GetTitle returns YoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadata) GetTitle() string { return v.Title } + +// GetSubject returns YoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { + return v.Subject +} + +// GetDate returns YoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } + +// GetPercentageWatched returns YoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadata) GetPercentageWatched() int { return v.PercentageWatched } + +// GetContentType returns YoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadata) GetContentType() ContentType { return v.ContentType } + +// YoutubeActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. +type YoutubeActivityMetadataSubjectIdentifier struct { + Value string `json:"value"` + IdentifierType IdentifierType `json:"identifierType"` +} + +// GetValue returns YoutubeActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } + +// GetIdentifierType returns YoutubeActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. +func (v *YoutubeActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { + return v.IdentifierType +} + +// __getActivityInput is used internally by genqlient +type __getActivityInput struct { + DataKey string `json:"dataKey"` + ActivityType []ActivityType `json:"activityType"` + Source Source `json:"source"` + Limit graphqlTypes.Int64 `json:"limit"` + Page graphqlTypes.Int64 `json:"page"` +} + +// GetDataKey returns __getActivityInput.DataKey, and is useful for accessing the field via an interface. +func (v *__getActivityInput) GetDataKey() string { return v.DataKey } + +// GetActivityType returns __getActivityInput.ActivityType, and is useful for accessing the field via an interface. +func (v *__getActivityInput) GetActivityType() []ActivityType { return v.ActivityType } + +// GetSource returns __getActivityInput.Source, and is useful for accessing the field via an interface. +func (v *__getActivityInput) GetSource() Source { return v.Source } + +// GetLimit returns __getActivityInput.Limit, and is useful for accessing the field via an interface. +func (v *__getActivityInput) GetLimit() graphqlTypes.Int64 { return v.Limit } + +// GetPage returns __getActivityInput.Page, and is useful for accessing the field via an interface. +func (v *__getActivityInput) GetPage() graphqlTypes.Int64 { return v.Page } + +// __getAppByPublicKeyInput is used internally by genqlient +type __getAppByPublicKeyInput struct { + PublicKey string `json:"publicKey"` +} + +// GetPublicKey returns __getAppByPublicKeyInput.PublicKey, and is useful for accessing the field via an interface. +func (v *__getAppByPublicKeyInput) GetPublicKey() string { return v.PublicKey } + +// __getTraitsInput is used internally by genqlient +type __getTraitsInput struct { + DataKey string `json:"dataKey"` + Source Source `json:"source"` + Labels []TraitLabel `json:"labels"` +} + +// GetDataKey returns __getTraitsInput.DataKey, and is useful for accessing the field via an interface. +func (v *__getTraitsInput) GetDataKey() string { return v.DataKey } + +// GetSource returns __getTraitsInput.Source, and is useful for accessing the field via an interface. +func (v *__getTraitsInput) GetSource() Source { return v.Source } + +// GetLabels returns __getTraitsInput.Labels, and is useful for accessing the field via an interface. +func (v *__getTraitsInput) GetLabels() []TraitLabel { return v.Labels } + +// __lookupActivityInput is used internally by genqlient +type __lookupActivityInput struct { + DataKey string `json:"dataKey"` + ActivityId uuid.UUID `json:"activityId"` +} + +// GetDataKey returns __lookupActivityInput.DataKey, and is useful for accessing the field via an interface. +func (v *__lookupActivityInput) GetDataKey() string { return v.DataKey } + +// GetActivityId returns __lookupActivityInput.ActivityId, and is useful for accessing the field via an interface. +func (v *__lookupActivityInput) GetActivityId() uuid.UUID { return v.ActivityId } + +// __lookupTraitInput is used internally by genqlient +type __lookupTraitInput struct { + DataKey string `json:"dataKey"` + TraitId uuid.UUID `json:"traitId"` +} + +// GetDataKey returns __lookupTraitInput.DataKey, and is useful for accessing the field via an interface. +func (v *__lookupTraitInput) GetDataKey() string { return v.DataKey } + +// GetTraitId returns __lookupTraitInput.TraitId, and is useful for accessing the field via an interface. +func (v *__lookupTraitInput) GetTraitId() uuid.UUID { return v.TraitId } + +// getActivityResponse is returned by getActivity on success. +type getActivityResponse struct { + GetActivity GetActivityActivityResponse `json:"getActivity"` +} + +// GetGetActivity returns getActivityResponse.GetActivity, and is useful for accessing the field via an interface. +func (v *getActivityResponse) GetGetActivity() GetActivityActivityResponse { return v.GetActivity } + +// getAppByPublicKeyResponse is returned by getAppByPublicKey on success. +type getAppByPublicKeyResponse struct { + GetAppByPublicKey GetAppByPublicKeyApplication `json:"getAppByPublicKey"` +} + +// GetGetAppByPublicKey returns getAppByPublicKeyResponse.GetAppByPublicKey, and is useful for accessing the field via an interface. +func (v *getAppByPublicKeyResponse) GetGetAppByPublicKey() GetAppByPublicKeyApplication { + return v.GetAppByPublicKey +} + +// getTraitsResponse is returned by getTraits on success. +type getTraitsResponse struct { + GetTraits []GetTraitsTrait `json:"getTraits"` +} + +// GetGetTraits returns getTraitsResponse.GetTraits, and is useful for accessing the field via an interface. +func (v *getTraitsResponse) GetGetTraits() []GetTraitsTrait { return v.GetTraits } + +// lookupActivityResponse is returned by lookupActivity on success. +type lookupActivityResponse struct { + LookupActivity LookupActivity `json:"lookupActivity"` +} + +// GetLookupActivity returns lookupActivityResponse.LookupActivity, and is useful for accessing the field via an interface. +func (v *lookupActivityResponse) GetLookupActivity() LookupActivity { return v.LookupActivity } + +// lookupTraitResponse is returned by lookupTrait on success. +type lookupTraitResponse struct { + LookupTrait LookupTrait `json:"lookupTrait"` +} + +// GetLookupTrait returns lookupTraitResponse.LookupTrait, and is useful for accessing the field via an interface. +func (v *lookupTraitResponse) GetLookupTrait() LookupTrait { return v.LookupTrait } + +// The query or mutation executed by getActivity. +const getActivity_Operation = ` +query getActivity ($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { + getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { + ... on ActivityResponse { + data { + ... on Activity { + id + metadata { + __typename + ... NetflixActivityMetadata + ... PlaystationActivityMetadata + ... AmazonActivityMetadata + ... BookingActivityMetadata + ... YoutubeActivityMetadata + ... UberActivityMetadata + ... InstacartActivityMetadata + ... UberEatsActivityMetadata + } + } + } + limit + total + page + } + } +} +fragment NetflixActivityMetadata on NetflixActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + lastPlayedAt +} +fragment PlaystationActivityMetadata on PlaystationActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + lastPlayedAt +} +fragment AmazonActivityMetadata on AmazonActivityMetadata { + productName + subject { + ... on Identifier { + value + identifierType + } + } + date + quantityPurchased + totalCost +} +fragment BookingActivityMetadata on BookingActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + bookingID + price + bookings { + ... on BookingItem { + startDateTime + endDateTime + address + depatureLocation + arrivalLocation + layoverLocations + activityType + } + } +} +fragment YoutubeActivityMetadata on YoutubeActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + percentageWatched + contentType +} +fragment UberActivityMetadata on UberActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + beginTripTime + dropoffTime + cost + city + distance + status +} +fragment InstacartActivityMetadata on InstacartActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + retailer + totalOrderAmountSpent + dateOrdered + dateDelivered + statusString + items { + ... on InstacartOrderItem { + itemID + productName + unitPrice + status + quantityPurchased + } + } +} +fragment UberEatsActivityMetadata on UberEatsActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + date + restaurant + currency + totalPrice + UberEatsActivityMetadataStatus: status + UberEatsActivityMetadataItems: items { + ... on UberEatsOrderItem { + name + price + quantityPurchased + customizations { + ... on UberEatsOrderItemCustomizations { + customization + value + quantity + } + } + } + } +} +` + +func (eye EyeOfSauron) GetActivity( + ctx_ context.Context, + dataKey string, + activityType []ActivityType, + source Source, + limit graphqlTypes.Int64, + page graphqlTypes.Int64, +) (*getActivityResponse, error) { + req := graphql2.NewRequest(getActivity_Operation) + + req.Var("dataKey", dataKey) + req.Var("activityType", activityType) + req.Var("source", source) + req.Var("limit", limit) + req.Var("page", page) + requestBodyObj := struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + }{ + Query: req.Query(), + Variables: req.Vars(), + } + + var requestBody bytes.Buffer + if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { + return nil, fmt.Errorf("unable to encode body %s", err) + } + + var err_ error + signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) + if err_ != nil { + return nil, fmt.Errorf("unable to generate signature: %v", err_) + } + + req.Header.Set("X-Gandalf-Signature", signatureB64) + + var resp_ getActivityResponse + + if err_ := eye.client.Run( + ctx_, + req, + &resp_, + ); err_ != nil { + return nil, fmt.Errorf("failed to execute request: %v", err_) + } + + return &resp_, nil +} + +// The query or mutation executed by getAppByPublicKey. +const getAppByPublicKey_Operation = ` +query getAppByPublicKey ($publicKey: String!) { + getAppByPublicKey(publicKey: $publicKey) { + ... on Application { + appName + publicKey + iconURL + gandalfID + appRegistrar + } + } +} +` + +func (eye EyeOfSauron) GetAppByPublicKey( + ctx_ context.Context, + publicKey string, +) (*getAppByPublicKeyResponse, error) { + req := graphql2.NewRequest(getAppByPublicKey_Operation) + + req.Var("publicKey", publicKey) + requestBodyObj := struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + }{ + Query: req.Query(), + Variables: req.Vars(), + } + + var requestBody bytes.Buffer + if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { + return nil, fmt.Errorf("unable to encode body %s", err) + } + + var err_ error + signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) + if err_ != nil { + return nil, fmt.Errorf("unable to generate signature: %v", err_) + } + + req.Header.Set("X-Gandalf-Signature", signatureB64) + + var resp_ getAppByPublicKeyResponse + + if err_ := eye.client.Run( + ctx_, + req, + &resp_, + ); err_ != nil { + return nil, fmt.Errorf("failed to execute request: %v", err_) + } + + return &resp_, nil +} + +// The query or mutation executed by getTraits. +const getTraits_Operation = ` +query getTraits ($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { + getTraits(dataKey: $dataKey, source: $source, labels: $labels) { + ... on Trait { + id + source + label + value + timestamp + } + } +} +` + +func (eye EyeOfSauron) GetTraits( + ctx_ context.Context, + dataKey string, + source Source, + labels []TraitLabel, +) (*getTraitsResponse, error) { + req := graphql2.NewRequest(getTraits_Operation) + + req.Var("dataKey", dataKey) + req.Var("source", source) + req.Var("labels", labels) + requestBodyObj := struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + }{ + Query: req.Query(), + Variables: req.Vars(), + } + + var requestBody bytes.Buffer + if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { + return nil, fmt.Errorf("unable to encode body %s", err) + } + + var err_ error + signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) + if err_ != nil { + return nil, fmt.Errorf("unable to generate signature: %v", err_) + } + + req.Header.Set("X-Gandalf-Signature", signatureB64) + + var resp_ getTraitsResponse + + if err_ := eye.client.Run( + ctx_, + req, + &resp_, + ); err_ != nil { + return nil, fmt.Errorf("failed to execute request: %v", err_) + } + + return &resp_, nil +} + +// The query or mutation executed by lookupActivity. +const lookupActivity_Operation = ` +query lookupActivity ($dataKey: String!, $activityId: UUID!) { + lookupActivity(dataKey: $dataKey, activityId: $activityId) { + ... on Activity { + id + metadata { + __typename + ... NetflixActivityMetadata + ... PlaystationActivityMetadata + ... AmazonActivityMetadata + ... BookingActivityMetadata + ... YoutubeActivityMetadata + ... UberActivityMetadata + ... InstacartActivityMetadata + ... UberEatsActivityMetadata + } + } + } +} +fragment NetflixActivityMetadata on NetflixActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + lastPlayedAt +} +fragment PlaystationActivityMetadata on PlaystationActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + lastPlayedAt +} +fragment AmazonActivityMetadata on AmazonActivityMetadata { + productName + subject { + ... on Identifier { + value + identifierType + } + } + date + quantityPurchased + totalCost +} +fragment BookingActivityMetadata on BookingActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + bookingID + price + bookings { + ... on BookingItem { + startDateTime + endDateTime + address + depatureLocation + arrivalLocation + layoverLocations + activityType + } + } +} +fragment YoutubeActivityMetadata on YoutubeActivityMetadata { + title + subject { + ... on Identifier { + value + identifierType + } + } + date + percentageWatched + contentType +} +fragment UberActivityMetadata on UberActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + beginTripTime + dropoffTime + cost + city + distance + status +} +fragment InstacartActivityMetadata on InstacartActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + retailer + totalOrderAmountSpent + dateOrdered + dateDelivered + statusString + items { + ... on InstacartOrderItem { + itemID + productName + unitPrice + status + quantityPurchased + } + } +} +fragment UberEatsActivityMetadata on UberEatsActivityMetadata { + subject { + ... on Identifier { + value + identifierType + } + } + date + restaurant + currency + totalPrice + UberEatsActivityMetadataStatus: status + UberEatsActivityMetadataItems: items { + ... on UberEatsOrderItem { + name + price + quantityPurchased + customizations { + ... on UberEatsOrderItemCustomizations { + customization + value + quantity + } + } + } + } +} +` + +func (eye EyeOfSauron) LookupActivity( + ctx_ context.Context, + dataKey string, + activityId uuid.UUID, +) (*lookupActivityResponse, error) { + req := graphql2.NewRequest(lookupActivity_Operation) + + req.Var("dataKey", dataKey) + req.Var("activityId", activityId) + requestBodyObj := struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + }{ + Query: req.Query(), + Variables: req.Vars(), + } + + var requestBody bytes.Buffer + if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { + return nil, fmt.Errorf("unable to encode body %s", err) + } + + var err_ error + signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) + if err_ != nil { + return nil, fmt.Errorf("unable to generate signature: %v", err_) + } + + req.Header.Set("X-Gandalf-Signature", signatureB64) + + var resp_ lookupActivityResponse + + if err_ := eye.client.Run( + ctx_, + req, + &resp_, + ); err_ != nil { + return nil, fmt.Errorf("failed to execute request: %v", err_) + } + + return &resp_, nil +} + +// The query or mutation executed by lookupTrait. +const lookupTrait_Operation = ` +query lookupTrait ($dataKey: String!, $traitId: UUID!) { + lookupTrait(dataKey: $dataKey, traitId: $traitId) { + ... on Trait { + id + source + label + value + timestamp + } + } +} +` + +func (eye EyeOfSauron) LookupTrait( + ctx_ context.Context, + dataKey string, + traitId uuid.UUID, +) (*lookupTraitResponse, error) { + req := graphql2.NewRequest(lookupTrait_Operation) + + req.Var("dataKey", dataKey) + req.Var("traitId", traitId) + requestBodyObj := struct { + Query string `json:"query"` + Variables map[string]interface{} `json:"variables"` + }{ + Query: req.Query(), + Variables: req.Vars(), + } + + var requestBody bytes.Buffer + if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { + return nil, fmt.Errorf("unable to encode body %s", err) + } + + var err_ error + signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) + if err_ != nil { + return nil, fmt.Errorf("unable to generate signature: %v", err_) + } + + req.Header.Set("X-Gandalf-Signature", signatureB64) + + var resp_ lookupTraitResponse + + if err_ := eye.client.Run( + ctx_, + req, + &resp_, + ); err_ != nil { + return nil, fmt.Errorf("failed to execute request: %v", err_) + } + + return &resp_, nil +} diff --git a/eyeofsauron/example/generated/genqlient.graphql b/eyeofsauron/example/generated/genqlient.graphql new file mode 100644 index 0000000..99df021 --- /dev/null +++ b/eyeofsauron/example/generated/genqlient.graphql @@ -0,0 +1,216 @@ +fragment InstacartActivityMetadata on InstacartActivityMetadata { + subject: subject { + ... on Identifier { + value + identifierType + } + } + retailer: retailer + totalOrderAmountSpent: totalOrderAmountSpent + dateOrdered: dateOrdered + dateDelivered: dateDelivered + statusString: statusString + items: items { + ... on InstacartOrderItem { + itemID + productName + unitPrice + status + quantityPurchased + } + } +} + +fragment PlaystationActivityMetadata on PlaystationActivityMetadata { + title: title + subject: subject { + ... on Identifier { + value + identifierType + } + } + lastPlayedAt: lastPlayedAt +} + +fragment BookingActivityMetadata on BookingActivityMetadata { + subject: subject { + ... on Identifier { + value + identifierType + } + } + bookingID: bookingID + price: price + bookings: bookings { + ... on BookingItem { + startDateTime + endDateTime + address + depatureLocation + arrivalLocation + layoverLocations + activityType + } + } +} + +fragment UberActivityMetadata on UberActivityMetadata { + subject: subject { + ... on Identifier { + value + identifierType + } + } + beginTripTime: beginTripTime + dropoffTime: dropoffTime + cost: cost + city: city + distance: distance + status: status +} + +fragment YoutubeActivityMetadata on YoutubeActivityMetadata { + title: title + subject: subject { + ... on Identifier { + value + identifierType + } + } + date: date + percentageWatched: percentageWatched + contentType: contentType +} + +fragment UberEatsActivityMetadata on UberEatsActivityMetadata { + subject: subject { + ... on Identifier { + value + identifierType + } + } + date: date + restaurant: restaurant + currency: currency + totalPrice: totalPrice + UberEatsActivityMetadataStatus: status + UberEatsActivityMetadataItems: items { + ... on UberEatsOrderItem { + name + price + quantityPurchased + customizations { + ... on UberEatsOrderItemCustomizations { + customization + value + quantity + } + } + } + } +} + +fragment AmazonActivityMetadata on AmazonActivityMetadata { + productName: productName + subject: subject { + ... on Identifier { + value + identifierType + } + } + date: date + quantityPurchased: quantityPurchased + totalCost: totalCost +} + +fragment NetflixActivityMetadata on NetflixActivityMetadata { + title: title + subject: subject { + ... on Identifier { + value + identifierType + } + } + date: date + lastPlayedAt: lastPlayedAt +} + +query getActivity($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { + getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { + ... on ActivityResponse { + data { + ... on Activity { + id + metadata { + ...NetflixActivityMetadata + ...PlaystationActivityMetadata + ...AmazonActivityMetadata + ...BookingActivityMetadata + ...YoutubeActivityMetadata + ...UberActivityMetadata + ...InstacartActivityMetadata + ...UberEatsActivityMetadata + } + } + } + limit + total + page + } + } +} + +query lookupActivity($dataKey: String!, $activityId: UUID!) { + lookupActivity(dataKey: $dataKey, activityId: $activityId) { + ... on Activity { + id + metadata { + ...NetflixActivityMetadata + ...PlaystationActivityMetadata + ...AmazonActivityMetadata + ...BookingActivityMetadata + ...YoutubeActivityMetadata + ...UberActivityMetadata + ...InstacartActivityMetadata + ...UberEatsActivityMetadata + } + } + } +} + +query getAppByPublicKey($publicKey: String!) { + getAppByPublicKey(publicKey: $publicKey) { + ... on Application { + appName + publicKey + iconURL + gandalfID + appRegistrar + } + } +} + +query getTraits($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { + getTraits(dataKey: $dataKey, source: $source, labels: $labels) { + ... on Trait { + id + source + label + value + timestamp + } + } +} + +query lookupTrait($dataKey: String!, $traitId: UUID!) { + lookupTrait(dataKey: $dataKey, traitId: $traitId) { + ... on Trait { + id + source + label + value + timestamp + } + } +} + diff --git a/eyeofsauron/example/generated/genqlient.yaml b/eyeofsauron/example/generated/genqlient.yaml new file mode 100644 index 0000000..18dc746 --- /dev/null +++ b/eyeofsauron/example/generated/genqlient.yaml @@ -0,0 +1,14 @@ + +schema: schema.graphql +operations: +- genqlient.graphql +generated: generated.go +bindings: + Int64: + type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Int64 + Date: + type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Date + UUID: + type: github.com/google/uuid.UUID + Time: + type: time.Time diff --git a/eyeofsauron/example/generated/schema.graphql b/eyeofsauron/example/generated/schema.graphql new file mode 100644 index 0000000..e99bd5e --- /dev/null +++ b/eyeofsauron/example/generated/schema.graphql @@ -0,0 +1,247 @@ +type Activity { + id: String! + metadata: ActivityMetadata! +} + +interface ActivityMetadata { + subject: [Identifier] +} + +type ActivityResponse { + data: [Activity]! + limit: Int64! + total: Int64! + page: Int64! +} + +enum ActivityType { + TRIP + STAY + SHOP + PLAY + WATCH +} + +type AmazonActivityMetadata implements ActivityMetadata { + productName: String! + subject: [Identifier] + date: Date + quantityPurchased: Int! + totalCost: String! +} + +type Application { + appName: String! + publicKey: String! + iconURL: String! + gandalfID: Int64! + appRegistrar: String! +} + +type BookingActivityMetadata implements ActivityMetadata { + subject: [Identifier] + bookingID: String! + price: String! + bookings: [BookingItem]! +} + +type BookingItem { + startDateTime: Time! + endDateTime: Time! + address: String! + depatureLocation: String! + arrivalLocation: String! + layoverLocations: [String]! + activityType: ActivityType! +} + +scalar Boolean + +enum ContentType { + VIDEO + SHORTS + MUSIC +} + +scalar Date + +scalar Float + +scalar ID + +type Identifier { + value: String! + identifierType: IdentifierType! +} + +enum IdentifierType { + IMDB + MOBY + RAWG + IGDB + ASIN + PLAYSTATION + YOUTUBE + TVDB + TVMAZE + UBER + BOOKING + INSTACART + UBEREATS +} + +type InstacartActivityMetadata implements ActivityMetadata { + subject: [Identifier] + retailer: String! + totalOrderAmountSpent: String! + dateOrdered: Date! + dateDelivered: Date! + statusString: String! + items: [InstacartOrderItem]! +} + +enum InstacartItemStatus { + FOUND + REPLACED + TOREFUND +} + +type InstacartOrderItem { + itemID: String! + productName: String! + unitPrice: String! + status: InstacartItemStatus! + quantityPurchased: Int64! +} + +enum InstacartOrderStatus { + COMPLETE +} + +scalar Int + +scalar Int64 + +scalar JSON + +scalar Map + +type NetflixActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + date: Date + lastPlayedAt: Date +} + +type PlaystationActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + lastPlayedAt: Date +} + +type Query { + getActivity(dataKey: String!, activityType: [ActivityType], source: Source!, limit: Int64!, page: Int64!): ActivityResponse! + lookupActivity(dataKey: String!, activityId: UUID!): Activity! + getAppByPublicKey(publicKey: String!): Application! + getTraits(dataKey: String!, source: Source!, labels: [TraitLabel]!): [Trait]! + lookupTrait(dataKey: String!, traitId: UUID!): Trait! +} + +enum Source { + NETFLIX + PLAYSTATION + YOUTUBE + AMAZON + UBER + BOOKING + INSTACART + INSTAGRAM + X + UBEREATS + GANDALF +} + +scalar String + +scalar Time + +type Trait { + id: UUID! + source: Source! + label: TraitLabel! + value: String! + timestamp: Time! +} + +enum TraitLabel { + PRIME_SUBSCRIBER + RATING + TRIP_COUNT + ACCOUNT_CREATED_ON + PLAN + GENIUS_LEVEL + FOLLOWER_COUNT + FOLLOWING_COUNT + USERNAME + POST_COUNT + EMAIL + ORDER_COUNT +} + +enum TripStatus { + CANCELED + COMPLETED + UNFULFILLED +} + +scalar UUID + +type UberActivityMetadata implements ActivityMetadata { + subject: [Identifier] + beginTripTime: Time! + dropoffTime: Time + cost: String! + city: String! + distance: String! + status: TripStatus! +} + +type UberEatsActivityMetadata implements ActivityMetadata { + subject: [Identifier] + date: Date + restaurant: String! + currency: String! + totalPrice: Float! + status: UberEatsOrderStatus! + items: [UberEatsOrderItem]! +} + +type UberEatsOrderItem { + name: String! + price: String! + quantityPurchased: Int64! + customizations: [UberEatsOrderItemCustomizations]! +} + +type UberEatsOrderItemCustomizations { + customization: String! + value: String! + quantity: Int64! +} + +enum UberEatsOrderStatus { + SUCCESS + EATER_CANCELLED + RESTAURANT_CANCELLED + RESTAURANT_UNFULFILLED + UNKNOWN +} + +type YoutubeActivityMetadata implements ActivityMetadata { + title: String! + subject: [Identifier] + date: Date + percentageWatched: Int! + contentType: ContentType! +} + diff --git a/eyeofsauron/example/main.go b/eyeofsauron/example/main.go index b1604ad..33fd6c5 100644 --- a/eyeofsauron/example/main.go +++ b/eyeofsauron/example/main.go @@ -6,7 +6,7 @@ import ( "fmt" "log" - "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/generated" + "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/example/generated" "github.com/google/uuid" ) From 2e2a0f706a89f7cea876edfea6637c71b5638d0a Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 15:03:13 +0000 Subject: [PATCH 13/14] Clean up redundant generated files Signed-off-by: Bashorun97 --- example/generated/generated.go | 3475 --------------------------- example/generated/genqlient.graphql | 216 -- example/generated/genqlient.yaml | 14 - example/generated/schema.graphql | 247 -- 4 files changed, 3952 deletions(-) delete mode 100644 example/generated/generated.go delete mode 100644 example/generated/genqlient.graphql delete mode 100644 example/generated/genqlient.yaml delete mode 100644 example/generated/schema.graphql diff --git a/example/generated/generated.go b/example/generated/generated.go deleted file mode 100644 index 88b5001..0000000 --- a/example/generated/generated.go +++ /dev/null @@ -1,3475 +0,0 @@ -// Code generated by github.com/gandalf-network/gandalf-sdk-go/eyeofsauron, DO NOT EDIT. - -package generated - -import ( - "bytes" - "context" - "crypto/ecdsa" - "crypto/rand" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "encoding/json" - "fmt" - "strings" - "time" - - "github.com/btcsuite/btcd/btcec/v2" - graphql2 "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphql" - "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes" - "github.com/gandalf-network/genqlient/graphql" - "github.com/google/uuid" -) - -type EyeOfSauron struct { - client *graphql2.Client - privateKey *ecdsa.PrivateKey -} - -func NewEyeOfSauron(privateKey string) (*EyeOfSauron, error) { - client := graphql2.NewClient("https://sauron.gandalf.network/public/gql") - privKey, err := HexToECDSAPrivateKey(privateKey) - if err != nil { - return nil, fmt.Errorf("failed to parse private key: %v", err) - } - return &EyeOfSauron{ - privateKey: privKey, - client: client, - }, nil -} - -// HexToECDSAPrivateKey converts a hexadecimal string representing a private key -// into an *ecdsa.PrivateKey for the secp256k1 curve. -func HexToECDSAPrivateKey(hexKey string) (*ecdsa.PrivateKey, error) { - trimmedHexKey := strings.TrimPrefix(hexKey, "0x") - - privKeyBytes, err := hex.DecodeString(trimmedHexKey) - if err != nil { - return nil, fmt.Errorf("failed to decode hex string: %v", err) - } - - privKey, _ := btcec.PrivKeyFromBytes(privKeyBytes) - - return privKey.ToECDSA(), nil -} - -// SignMessage signs a message using the given ECDSA private key. -func SignMessageAsBase64(privKey *ecdsa.PrivateKey, message []byte) (string, error) { - hash := sha256.Sum256(message) - - signature, err := ecdsa.SignASN1(rand.Reader, privKey, hash[:]) - if err != nil { - return "", fmt.Errorf("failed to sign message: %v", err) - } - - signatureB64 := base64.StdEncoding.EncodeToString(signature) - - return signatureB64, nil -} - -type ActivityType string - -const ( - ActivityTypeTrip ActivityType = "TRIP" - ActivityTypeStay ActivityType = "STAY" - ActivityTypeShop ActivityType = "SHOP" - ActivityTypePlay ActivityType = "PLAY" - ActivityTypeWatch ActivityType = "WATCH" -) - -// AmazonActivityMetadata includes the GraphQL fields of AmazonActivityMetadata requested by the fragment AmazonActivityMetadata. -type AmazonActivityMetadata struct { - ProductName string `json:"productName"` - Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - QuantityPurchased int `json:"quantityPurchased"` - TotalCost string `json:"totalCost"` -} - -// GetProductName returns AmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadata) GetProductName() string { return v.ProductName } - -// GetSubject returns AmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetDate returns AmazonActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } - -// GetQuantityPurchased returns AmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadata) GetQuantityPurchased() int { return v.QuantityPurchased } - -// GetTotalCost returns AmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadata) GetTotalCost() string { return v.TotalCost } - -// AmazonActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type AmazonActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns AmazonActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns AmazonActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *AmazonActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -// BookingActivityMetadata includes the GraphQL fields of BookingActivityMetadata requested by the fragment BookingActivityMetadata. -type BookingActivityMetadata struct { - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` - BookingID string `json:"bookingID"` - Price string `json:"price"` - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` -} - -// GetSubject returns BookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetBookingID returns BookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetBookingID() string { return v.BookingID } - -// GetPrice returns BookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetPrice() string { return v.Price } - -// GetBookings returns BookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.Bookings -} - -// BookingActivityMetadataBookingsBookingItem includes the requested fields of the GraphQL type BookingItem. -type BookingActivityMetadataBookingsBookingItem struct { - StartDateTime time.Time `json:"startDateTime"` - EndDateTime time.Time `json:"endDateTime"` - Address string `json:"address"` - DepatureLocation string `json:"depatureLocation"` - ArrivalLocation string `json:"arrivalLocation"` - LayoverLocations []string `json:"layoverLocations"` - ActivityType ActivityType `json:"activityType"` -} - -// GetStartDateTime returns BookingActivityMetadataBookingsBookingItem.StartDateTime, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetStartDateTime() time.Time { - return v.StartDateTime -} - -// GetEndDateTime returns BookingActivityMetadataBookingsBookingItem.EndDateTime, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetEndDateTime() time.Time { return v.EndDateTime } - -// GetAddress returns BookingActivityMetadataBookingsBookingItem.Address, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetAddress() string { return v.Address } - -// GetDepatureLocation returns BookingActivityMetadataBookingsBookingItem.DepatureLocation, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetDepatureLocation() string { - return v.DepatureLocation -} - -// GetArrivalLocation returns BookingActivityMetadataBookingsBookingItem.ArrivalLocation, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetArrivalLocation() string { - return v.ArrivalLocation -} - -// GetLayoverLocations returns BookingActivityMetadataBookingsBookingItem.LayoverLocations, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetLayoverLocations() []string { - return v.LayoverLocations -} - -// GetActivityType returns BookingActivityMetadataBookingsBookingItem.ActivityType, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataBookingsBookingItem) GetActivityType() ActivityType { - return v.ActivityType -} - -// BookingActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type BookingActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns BookingActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns BookingActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *BookingActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -type ContentType string - -const ( - ContentTypeVideo ContentType = "VIDEO" - ContentTypeShorts ContentType = "SHORTS" - ContentTypeMusic ContentType = "MUSIC" -) - -// GetActivityActivityResponse includes the requested fields of the GraphQL type ActivityResponse. -type GetActivityActivityResponse struct { - Data []GetActivityActivityResponseDataActivity `json:"data"` - Limit graphqlTypes.Int64 `json:"limit"` - Total graphqlTypes.Int64 `json:"total"` - Page graphqlTypes.Int64 `json:"page"` -} - -// GetData returns GetActivityActivityResponse.Data, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponse) GetData() []GetActivityActivityResponseDataActivity { - return v.Data -} - -// GetLimit returns GetActivityActivityResponse.Limit, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponse) GetLimit() graphqlTypes.Int64 { return v.Limit } - -// GetTotal returns GetActivityActivityResponse.Total, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponse) GetTotal() graphqlTypes.Int64 { return v.Total } - -// GetPage returns GetActivityActivityResponse.Page, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponse) GetPage() graphqlTypes.Int64 { return v.Page } - -// GetActivityActivityResponseDataActivity includes the requested fields of the GraphQL type Activity. -type GetActivityActivityResponseDataActivity struct { - Id string `json:"id"` - Metadata GetActivityActivityResponseDataActivityMetadata `json:"-"` -} - -// GetId returns GetActivityActivityResponseDataActivity.Id, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivity) GetId() string { return v.Id } - -// GetMetadata returns GetActivityActivityResponseDataActivity.Metadata, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivity) GetMetadata() GetActivityActivityResponseDataActivityMetadata { - return v.Metadata -} - -func (v *GetActivityActivityResponseDataActivity) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivity - Metadata json.RawMessage `json:"metadata"` - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivity = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - { - dst := &v.Metadata - src := firstPass.Metadata - if len(src) != 0 && string(src) != "null" { - err = __unmarshalGetActivityActivityResponseDataActivityMetadata( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal GetActivityActivityResponseDataActivity.Metadata: %w", err) - } - } - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivity struct { - Id string `json:"id"` - - Metadata json.RawMessage `json:"metadata"` -} - -func (v *GetActivityActivityResponseDataActivity) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivity) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivity, error) { - var retval __premarshalGetActivityActivityResponseDataActivity - - retval.Id = v.Id - { - - dst := &retval.Metadata - src := v.Metadata - var err error - *dst, err = __marshalGetActivityActivityResponseDataActivityMetadata( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal GetActivityActivityResponseDataActivity.Metadata: %w", err) - } - } - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadata includes the requested fields of the GraphQL interface ActivityMetadata. -// -// GetActivityActivityResponseDataActivityMetadata is implemented by the following types: -// GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata -// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata -// GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata -// GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata -// GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata -// GetActivityActivityResponseDataActivityMetadataUberActivityMetadata -// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata -// GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata -type GetActivityActivityResponseDataActivityMetadata interface { - implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() string -} - -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceGetActivityActivityResponseDataActivityMetadata() { -} - -func __unmarshalGetActivityActivityResponseDataActivityMetadata(b []byte, v *GetActivityActivityResponseDataActivityMetadata) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "AmazonActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) - return json.Unmarshal(b, *v) - case "BookingActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) - return json.Unmarshal(b, *v) - case "InstacartActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) - return json.Unmarshal(b, *v) - case "NetflixActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) - return json.Unmarshal(b, *v) - case "PlaystationActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) - return json.Unmarshal(b, *v) - case "UberActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) - return json.Unmarshal(b, *v) - case "UberEatsActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) - return json.Unmarshal(b, *v) - case "YoutubeActivityMetadata": - *v = new(GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing ActivityMetadata.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for GetActivityActivityResponseDataActivityMetadata: "%v"`, tn.TypeName) - } -} - -func __marshalGetActivityActivityResponseDataActivityMetadata(v *GetActivityActivityResponseDataActivityMetadata) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata: - typename = "AmazonActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata: - typename = "BookingActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata: - typename = "InstacartActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata: - typename = "NetflixActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata: - typename = "PlaystationActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata: - typename = "UberActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata: - typename = "UberEatsActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata: - typename = "YoutubeActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for GetActivityActivityResponseDataActivityMetadata: "%T"`, v) - } -} - -// GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata includes the requested fields of the GraphQL type AmazonActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata struct { - Typename string `json:"__typename"` - AmazonActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetProductName returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetProductName() string { - return v.AmazonActivityMetadata.ProductName -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { - return v.AmazonActivityMetadata.Subject -} - -// GetDate returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetDate() graphqlTypes.Date { - return v.AmazonActivityMetadata.Date -} - -// GetQuantityPurchased returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetQuantityPurchased() int { - return v.AmazonActivityMetadata.QuantityPurchased -} - -// GetTotalCost returns GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) GetTotalCost() string { - return v.AmazonActivityMetadata.TotalCost -} - -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.AmazonActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata struct { - Typename string `json:"__typename"` - - ProductName string `json:"productName"` - - Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - QuantityPurchased int `json:"quantityPurchased"` - - TotalCost string `json:"totalCost"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataAmazonActivityMetadata - - retval.Typename = v.Typename - retval.ProductName = v.AmazonActivityMetadata.ProductName - retval.Subject = v.AmazonActivityMetadata.Subject - retval.Date = v.AmazonActivityMetadata.Date - retval.QuantityPurchased = v.AmazonActivityMetadata.QuantityPurchased - retval.TotalCost = v.AmazonActivityMetadata.TotalCost - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - BookingActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.BookingActivityMetadata.Subject -} - -// GetBookingID returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookingID() string { - return v.BookingActivityMetadata.BookingID -} - -// GetPrice returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetPrice() string { - return v.BookingActivityMetadata.Price -} - -// GetBookings returns GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.BookingActivityMetadata.Bookings -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.BookingActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` - - BookingID string `json:"bookingID"` - - Price string `json:"price"` - - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataBookingActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.BookingActivityMetadata.Subject - retval.BookingID = v.BookingActivityMetadata.BookingID - retval.Price = v.BookingActivityMetadata.Price - retval.Bookings = v.BookingActivityMetadata.Bookings - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - InstacartActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { - return v.InstacartActivityMetadata.Subject -} - -// GetRetailer returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetRetailer() string { - return v.InstacartActivityMetadata.Retailer -} - -// GetTotalOrderAmountSpent returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { - return v.InstacartActivityMetadata.TotalOrderAmountSpent -} - -// GetDateOrdered returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateOrdered -} - -// GetDateDelivered returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateDelivered -} - -// GetStatusString returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetStatusString() string { - return v.InstacartActivityMetadata.StatusString -} - -// GetItems returns GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { - return v.InstacartActivityMetadata.Items -} - -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.InstacartActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` - - Retailer string `json:"retailer"` - - TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` - - DateOrdered graphqlTypes.Date `json:"dateOrdered"` - - DateDelivered graphqlTypes.Date `json:"dateDelivered"` - - StatusString string `json:"statusString"` - - Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataInstacartActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.InstacartActivityMetadata.Subject - retval.Retailer = v.InstacartActivityMetadata.Retailer - retval.TotalOrderAmountSpent = v.InstacartActivityMetadata.TotalOrderAmountSpent - retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered - retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered - retval.StatusString = v.InstacartActivityMetadata.StatusString - retval.Items = v.InstacartActivityMetadata.Items - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata includes the requested fields of the GraphQL type NetflixActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata struct { - Typename string `json:"__typename"` - NetflixActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetTitle returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetTitle() string { - return v.NetflixActivityMetadata.Title -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { - return v.NetflixActivityMetadata.Subject -} - -// GetDate returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetDate() graphqlTypes.Date { - return v.NetflixActivityMetadata.Date -} - -// GetLastPlayedAt returns GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { - return v.NetflixActivityMetadata.LastPlayedAt -} - -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.NetflixActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataNetflixActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.NetflixActivityMetadata.Title - retval.Subject = v.NetflixActivityMetadata.Subject - retval.Date = v.NetflixActivityMetadata.Date - retval.LastPlayedAt = v.NetflixActivityMetadata.LastPlayedAt - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata includes the requested fields of the GraphQL type PlaystationActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata struct { - Typename string `json:"__typename"` - PlaystationActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetTitle returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetTitle() string { - return v.PlaystationActivityMetadata.Title -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { - return v.PlaystationActivityMetadata.Subject -} - -// GetLastPlayedAt returns GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { - return v.PlaystationActivityMetadata.LastPlayedAt -} - -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.PlaystationActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` - - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataPlaystationActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.PlaystationActivityMetadata.Title - retval.Subject = v.PlaystationActivityMetadata.Subject - retval.LastPlayedAt = v.PlaystationActivityMetadata.LastPlayedAt - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataUberActivityMetadata includes the requested fields of the GraphQL type UberActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataUberActivityMetadata struct { - Typename string `json:"__typename"` - UberActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { - return v.UberActivityMetadata.Subject -} - -// GetBeginTripTime returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetBeginTripTime() time.Time { - return v.UberActivityMetadata.BeginTripTime -} - -// GetDropoffTime returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetDropoffTime() time.Time { - return v.UberActivityMetadata.DropoffTime -} - -// GetCost returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Cost, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetCost() string { - return v.UberActivityMetadata.Cost -} - -// GetCity returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.City, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetCity() string { - return v.UberActivityMetadata.City -} - -// GetDistance returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Distance, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetDistance() string { - return v.UberActivityMetadata.Distance -} - -// GetStatus returns GetActivityActivityResponseDataActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) GetStatus() TripStatus { - return v.UberActivityMetadata.Status -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataUberActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` - - BeginTripTime time.Time `json:"beginTripTime"` - - DropoffTime time.Time `json:"dropoffTime"` - - Cost string `json:"cost"` - - City string `json:"city"` - - Distance string `json:"distance"` - - Status TripStatus `json:"status"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataUberActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberActivityMetadata.Subject - retval.BeginTripTime = v.UberActivityMetadata.BeginTripTime - retval.DropoffTime = v.UberActivityMetadata.DropoffTime - retval.Cost = v.UberActivityMetadata.Cost - retval.City = v.UberActivityMetadata.City - retval.Distance = v.UberActivityMetadata.Distance - retval.Status = v.UberActivityMetadata.Status - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - UberEatsActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.UberEatsActivityMetadata.Subject -} - -// GetDate returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { - return v.UberEatsActivityMetadata.Date -} - -// GetRestaurant returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { - return v.UberEatsActivityMetadata.Restaurant -} - -// GetCurrency returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetCurrency() string { - return v.UberEatsActivityMetadata.Currency -} - -// GetTotalPrice returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { - return v.UberEatsActivityMetadata.TotalPrice -} - -// GetUberEatsActivityMetadataStatus returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus -} - -// GetUberEatsActivityMetadataItems returns GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataItems -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberEatsActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - Restaurant string `json:"restaurant"` - - Currency string `json:"currency"` - - TotalPrice float64 `json:"totalPrice"` - - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - - UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataUberEatsActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberEatsActivityMetadata.Subject - retval.Date = v.UberEatsActivityMetadata.Date - retval.Restaurant = v.UberEatsActivityMetadata.Restaurant - retval.Currency = v.UberEatsActivityMetadata.Currency - retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus - retval.UberEatsActivityMetadataItems = v.UberEatsActivityMetadata.UberEatsActivityMetadataItems - return &retval, nil -} - -// GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. -type GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata struct { - Typename string `json:"__typename"` - YoutubeActivityMetadata `json:"-"` -} - -// GetTypename returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetTypename() string { - return v.Typename -} - -// GetTitle returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetTitle() string { - return v.YoutubeActivityMetadata.Title -} - -// GetSubject returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { - return v.YoutubeActivityMetadata.Subject -} - -// GetDate returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetDate() graphqlTypes.Date { - return v.YoutubeActivityMetadata.Date -} - -// GetPercentageWatched returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetPercentageWatched() int { - return v.YoutubeActivityMetadata.PercentageWatched -} - -// GetContentType returns GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) GetContentType() ContentType { - return v.YoutubeActivityMetadata.ContentType -} - -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.YoutubeActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - PercentageWatched int `json:"percentageWatched"` - - ContentType ContentType `json:"contentType"` -} - -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *GetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata) __premarshalJSON() (*__premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata, error) { - var retval __premarshalGetActivityActivityResponseDataActivityMetadataYoutubeActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.YoutubeActivityMetadata.Title - retval.Subject = v.YoutubeActivityMetadata.Subject - retval.Date = v.YoutubeActivityMetadata.Date - retval.PercentageWatched = v.YoutubeActivityMetadata.PercentageWatched - retval.ContentType = v.YoutubeActivityMetadata.ContentType - return &retval, nil -} - -// GetAppByPublicKeyApplication includes the requested fields of the GraphQL type Application. -type GetAppByPublicKeyApplication struct { - AppName string `json:"appName"` - PublicKey string `json:"publicKey"` - IconURL string `json:"iconURL"` - GandalfID graphqlTypes.Int64 `json:"gandalfID"` - AppRegistrar string `json:"appRegistrar"` -} - -// GetAppName returns GetAppByPublicKeyApplication.AppName, and is useful for accessing the field via an interface. -func (v *GetAppByPublicKeyApplication) GetAppName() string { return v.AppName } - -// GetPublicKey returns GetAppByPublicKeyApplication.PublicKey, and is useful for accessing the field via an interface. -func (v *GetAppByPublicKeyApplication) GetPublicKey() string { return v.PublicKey } - -// GetIconURL returns GetAppByPublicKeyApplication.IconURL, and is useful for accessing the field via an interface. -func (v *GetAppByPublicKeyApplication) GetIconURL() string { return v.IconURL } - -// GetGandalfID returns GetAppByPublicKeyApplication.GandalfID, and is useful for accessing the field via an interface. -func (v *GetAppByPublicKeyApplication) GetGandalfID() graphqlTypes.Int64 { return v.GandalfID } - -// GetAppRegistrar returns GetAppByPublicKeyApplication.AppRegistrar, and is useful for accessing the field via an interface. -func (v *GetAppByPublicKeyApplication) GetAppRegistrar() string { return v.AppRegistrar } - -// GetTraitsTrait includes the requested fields of the GraphQL type Trait. -type GetTraitsTrait struct { - Id uuid.UUID `json:"id"` - Source Source `json:"source"` - Label TraitLabel `json:"label"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` -} - -// GetId returns GetTraitsTrait.Id, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetId() uuid.UUID { return v.Id } - -// GetSource returns GetTraitsTrait.Source, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetSource() Source { return v.Source } - -// GetLabel returns GetTraitsTrait.Label, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetLabel() TraitLabel { return v.Label } - -// GetValue returns GetTraitsTrait.Value, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetValue() string { return v.Value } - -// GetTimestamp returns GetTraitsTrait.Timestamp, and is useful for accessing the field via an interface. -func (v *GetTraitsTrait) GetTimestamp() time.Time { return v.Timestamp } - -type IdentifierType string - -const ( - IdentifierTypeImdb IdentifierType = "IMDB" - IdentifierTypeMoby IdentifierType = "MOBY" - IdentifierTypeRawg IdentifierType = "RAWG" - IdentifierTypeIgdb IdentifierType = "IGDB" - IdentifierTypeAsin IdentifierType = "ASIN" - IdentifierTypePlaystation IdentifierType = "PLAYSTATION" - IdentifierTypeYoutube IdentifierType = "YOUTUBE" - IdentifierTypeTvdb IdentifierType = "TVDB" - IdentifierTypeTvmaze IdentifierType = "TVMAZE" - IdentifierTypeUber IdentifierType = "UBER" - IdentifierTypeBooking IdentifierType = "BOOKING" - IdentifierTypeInstacart IdentifierType = "INSTACART" - IdentifierTypeUbereats IdentifierType = "UBEREATS" -) - -// InstacartActivityMetadata includes the GraphQL fields of InstacartActivityMetadata requested by the fragment InstacartActivityMetadata. -type InstacartActivityMetadata struct { - Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` - Retailer string `json:"retailer"` - TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` - DateOrdered graphqlTypes.Date `json:"dateOrdered"` - DateDelivered graphqlTypes.Date `json:"dateDelivered"` - StatusString string `json:"statusString"` - Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` -} - -// GetSubject returns InstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetRetailer returns InstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetRetailer() string { return v.Retailer } - -// GetTotalOrderAmountSpent returns InstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetTotalOrderAmountSpent() string { return v.TotalOrderAmountSpent } - -// GetDateOrdered returns InstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { return v.DateOrdered } - -// GetDateDelivered returns InstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { return v.DateDelivered } - -// GetStatusString returns InstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetStatusString() string { return v.StatusString } - -// GetItems returns InstacartActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { - return v.Items -} - -// InstacartActivityMetadataItemsInstacartOrderItem includes the requested fields of the GraphQL type InstacartOrderItem. -type InstacartActivityMetadataItemsInstacartOrderItem struct { - ItemID string `json:"itemID"` - ProductName string `json:"productName"` - UnitPrice string `json:"unitPrice"` - Status InstacartItemStatus `json:"status"` - QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` -} - -// GetItemID returns InstacartActivityMetadataItemsInstacartOrderItem.ItemID, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetItemID() string { return v.ItemID } - -// GetProductName returns InstacartActivityMetadataItemsInstacartOrderItem.ProductName, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetProductName() string { - return v.ProductName -} - -// GetUnitPrice returns InstacartActivityMetadataItemsInstacartOrderItem.UnitPrice, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetUnitPrice() string { return v.UnitPrice } - -// GetStatus returns InstacartActivityMetadataItemsInstacartOrderItem.Status, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetStatus() InstacartItemStatus { - return v.Status -} - -// GetQuantityPurchased returns InstacartActivityMetadataItemsInstacartOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataItemsInstacartOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { - return v.QuantityPurchased -} - -// InstacartActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type InstacartActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns InstacartActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns InstacartActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *InstacartActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -type InstacartItemStatus string - -const ( - InstacartItemStatusFound InstacartItemStatus = "FOUND" - InstacartItemStatusReplaced InstacartItemStatus = "REPLACED" - InstacartItemStatusTorefund InstacartItemStatus = "TOREFUND" -) - -// LookupActivity includes the requested fields of the GraphQL type Activity. -type LookupActivity struct { - Id string `json:"id"` - Metadata LookupActivityMetadata `json:"-"` -} - -// GetId returns LookupActivity.Id, and is useful for accessing the field via an interface. -func (v *LookupActivity) GetId() string { return v.Id } - -// GetMetadata returns LookupActivity.Metadata, and is useful for accessing the field via an interface. -func (v *LookupActivity) GetMetadata() LookupActivityMetadata { return v.Metadata } - -func (v *LookupActivity) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivity - Metadata json.RawMessage `json:"metadata"` - graphql.NoUnmarshalJSON - } - firstPass.LookupActivity = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - { - dst := &v.Metadata - src := firstPass.Metadata - if len(src) != 0 && string(src) != "null" { - err = __unmarshalLookupActivityMetadata( - src, dst) - if err != nil { - return fmt.Errorf( - "unable to unmarshal LookupActivity.Metadata: %w", err) - } - } - } - return nil -} - -type __premarshalLookupActivity struct { - Id string `json:"id"` - - Metadata json.RawMessage `json:"metadata"` -} - -func (v *LookupActivity) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivity) __premarshalJSON() (*__premarshalLookupActivity, error) { - var retval __premarshalLookupActivity - - retval.Id = v.Id - { - - dst := &retval.Metadata - src := v.Metadata - var err error - *dst, err = __marshalLookupActivityMetadata( - &src) - if err != nil { - return nil, fmt.Errorf( - "unable to marshal LookupActivity.Metadata: %w", err) - } - } - return &retval, nil -} - -// LookupActivityMetadata includes the requested fields of the GraphQL interface ActivityMetadata. -// -// LookupActivityMetadata is implemented by the following types: -// LookupActivityMetadataAmazonActivityMetadata -// LookupActivityMetadataBookingActivityMetadata -// LookupActivityMetadataInstacartActivityMetadata -// LookupActivityMetadataNetflixActivityMetadata -// LookupActivityMetadataPlaystationActivityMetadata -// LookupActivityMetadataUberActivityMetadata -// LookupActivityMetadataUberEatsActivityMetadata -// LookupActivityMetadataYoutubeActivityMetadata -type LookupActivityMetadata interface { - implementsGraphQLInterfaceLookupActivityMetadata() - // GetTypename returns the receiver's concrete GraphQL type-name (see interface doc for possible values). - GetTypename() string -} - -func (v *LookupActivityMetadataAmazonActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataBookingActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataInstacartActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataNetflixActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataPlaystationActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataUberActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataUberEatsActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} -func (v *LookupActivityMetadataYoutubeActivityMetadata) implementsGraphQLInterfaceLookupActivityMetadata() { -} - -func __unmarshalLookupActivityMetadata(b []byte, v *LookupActivityMetadata) error { - if string(b) == "null" { - return nil - } - - var tn struct { - TypeName string `json:"__typename"` - } - err := json.Unmarshal(b, &tn) - if err != nil { - return err - } - - switch tn.TypeName { - case "AmazonActivityMetadata": - *v = new(LookupActivityMetadataAmazonActivityMetadata) - return json.Unmarshal(b, *v) - case "BookingActivityMetadata": - *v = new(LookupActivityMetadataBookingActivityMetadata) - return json.Unmarshal(b, *v) - case "InstacartActivityMetadata": - *v = new(LookupActivityMetadataInstacartActivityMetadata) - return json.Unmarshal(b, *v) - case "NetflixActivityMetadata": - *v = new(LookupActivityMetadataNetflixActivityMetadata) - return json.Unmarshal(b, *v) - case "PlaystationActivityMetadata": - *v = new(LookupActivityMetadataPlaystationActivityMetadata) - return json.Unmarshal(b, *v) - case "UberActivityMetadata": - *v = new(LookupActivityMetadataUberActivityMetadata) - return json.Unmarshal(b, *v) - case "UberEatsActivityMetadata": - *v = new(LookupActivityMetadataUberEatsActivityMetadata) - return json.Unmarshal(b, *v) - case "YoutubeActivityMetadata": - *v = new(LookupActivityMetadataYoutubeActivityMetadata) - return json.Unmarshal(b, *v) - case "": - return fmt.Errorf( - "response was missing ActivityMetadata.__typename") - default: - return fmt.Errorf( - `unexpected concrete type for LookupActivityMetadata: "%v"`, tn.TypeName) - } -} - -func __marshalLookupActivityMetadata(v *LookupActivityMetadata) ([]byte, error) { - - var typename string - switch v := (*v).(type) { - case *LookupActivityMetadataAmazonActivityMetadata: - typename = "AmazonActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataAmazonActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataBookingActivityMetadata: - typename = "BookingActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataBookingActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataInstacartActivityMetadata: - typename = "InstacartActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataInstacartActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataNetflixActivityMetadata: - typename = "NetflixActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataNetflixActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataPlaystationActivityMetadata: - typename = "PlaystationActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataPlaystationActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataUberActivityMetadata: - typename = "UberActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataUberActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataUberEatsActivityMetadata: - typename = "UberEatsActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataUberEatsActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case *LookupActivityMetadataYoutubeActivityMetadata: - typename = "YoutubeActivityMetadata" - - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - result := struct { - TypeName string `json:"__typename"` - *__premarshalLookupActivityMetadataYoutubeActivityMetadata - }{typename, premarshaled} - return json.Marshal(result) - case nil: - return []byte("null"), nil - default: - return nil, fmt.Errorf( - `unexpected concrete type for LookupActivityMetadata: "%T"`, v) - } -} - -// LookupActivityMetadataAmazonActivityMetadata includes the requested fields of the GraphQL type AmazonActivityMetadata. -type LookupActivityMetadataAmazonActivityMetadata struct { - Typename string `json:"__typename"` - AmazonActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataAmazonActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetTypename() string { return v.Typename } - -// GetProductName returns LookupActivityMetadataAmazonActivityMetadata.ProductName, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetProductName() string { - return v.AmazonActivityMetadata.ProductName -} - -// GetSubject returns LookupActivityMetadataAmazonActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetSubject() []AmazonActivityMetadataSubjectIdentifier { - return v.AmazonActivityMetadata.Subject -} - -// GetDate returns LookupActivityMetadataAmazonActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetDate() graphqlTypes.Date { - return v.AmazonActivityMetadata.Date -} - -// GetQuantityPurchased returns LookupActivityMetadataAmazonActivityMetadata.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetQuantityPurchased() int { - return v.AmazonActivityMetadata.QuantityPurchased -} - -// GetTotalCost returns LookupActivityMetadataAmazonActivityMetadata.TotalCost, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataAmazonActivityMetadata) GetTotalCost() string { - return v.AmazonActivityMetadata.TotalCost -} - -func (v *LookupActivityMetadataAmazonActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataAmazonActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataAmazonActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.AmazonActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataAmazonActivityMetadata struct { - Typename string `json:"__typename"` - - ProductName string `json:"productName"` - - Subject []AmazonActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - QuantityPurchased int `json:"quantityPurchased"` - - TotalCost string `json:"totalCost"` -} - -func (v *LookupActivityMetadataAmazonActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataAmazonActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataAmazonActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataAmazonActivityMetadata - - retval.Typename = v.Typename - retval.ProductName = v.AmazonActivityMetadata.ProductName - retval.Subject = v.AmazonActivityMetadata.Subject - retval.Date = v.AmazonActivityMetadata.Date - retval.QuantityPurchased = v.AmazonActivityMetadata.QuantityPurchased - retval.TotalCost = v.AmazonActivityMetadata.TotalCost - return &retval, nil -} - -// LookupActivityMetadataBookingActivityMetadata includes the requested fields of the GraphQL type BookingActivityMetadata. -type LookupActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - BookingActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataBookingActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataBookingActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetSubject() []BookingActivityMetadataSubjectIdentifier { - return v.BookingActivityMetadata.Subject -} - -// GetBookingID returns LookupActivityMetadataBookingActivityMetadata.BookingID, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetBookingID() string { - return v.BookingActivityMetadata.BookingID -} - -// GetPrice returns LookupActivityMetadataBookingActivityMetadata.Price, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetPrice() string { - return v.BookingActivityMetadata.Price -} - -// GetBookings returns LookupActivityMetadataBookingActivityMetadata.Bookings, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataBookingActivityMetadata) GetBookings() []BookingActivityMetadataBookingsBookingItem { - return v.BookingActivityMetadata.Bookings -} - -func (v *LookupActivityMetadataBookingActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataBookingActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataBookingActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.BookingActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataBookingActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []BookingActivityMetadataSubjectIdentifier `json:"subject"` - - BookingID string `json:"bookingID"` - - Price string `json:"price"` - - Bookings []BookingActivityMetadataBookingsBookingItem `json:"bookings"` -} - -func (v *LookupActivityMetadataBookingActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataBookingActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataBookingActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataBookingActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.BookingActivityMetadata.Subject - retval.BookingID = v.BookingActivityMetadata.BookingID - retval.Price = v.BookingActivityMetadata.Price - retval.Bookings = v.BookingActivityMetadata.Bookings - return &retval, nil -} - -// LookupActivityMetadataInstacartActivityMetadata includes the requested fields of the GraphQL type InstacartActivityMetadata. -type LookupActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - InstacartActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataInstacartActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataInstacartActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetSubject() []InstacartActivityMetadataSubjectIdentifier { - return v.InstacartActivityMetadata.Subject -} - -// GetRetailer returns LookupActivityMetadataInstacartActivityMetadata.Retailer, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetRetailer() string { - return v.InstacartActivityMetadata.Retailer -} - -// GetTotalOrderAmountSpent returns LookupActivityMetadataInstacartActivityMetadata.TotalOrderAmountSpent, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetTotalOrderAmountSpent() string { - return v.InstacartActivityMetadata.TotalOrderAmountSpent -} - -// GetDateOrdered returns LookupActivityMetadataInstacartActivityMetadata.DateOrdered, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateOrdered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateOrdered -} - -// GetDateDelivered returns LookupActivityMetadataInstacartActivityMetadata.DateDelivered, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetDateDelivered() graphqlTypes.Date { - return v.InstacartActivityMetadata.DateDelivered -} - -// GetStatusString returns LookupActivityMetadataInstacartActivityMetadata.StatusString, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetStatusString() string { - return v.InstacartActivityMetadata.StatusString -} - -// GetItems returns LookupActivityMetadataInstacartActivityMetadata.Items, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataInstacartActivityMetadata) GetItems() []InstacartActivityMetadataItemsInstacartOrderItem { - return v.InstacartActivityMetadata.Items -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataInstacartActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataInstacartActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.InstacartActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataInstacartActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []InstacartActivityMetadataSubjectIdentifier `json:"subject"` - - Retailer string `json:"retailer"` - - TotalOrderAmountSpent string `json:"totalOrderAmountSpent"` - - DateOrdered graphqlTypes.Date `json:"dateOrdered"` - - DateDelivered graphqlTypes.Date `json:"dateDelivered"` - - StatusString string `json:"statusString"` - - Items []InstacartActivityMetadataItemsInstacartOrderItem `json:"items"` -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataInstacartActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataInstacartActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataInstacartActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.InstacartActivityMetadata.Subject - retval.Retailer = v.InstacartActivityMetadata.Retailer - retval.TotalOrderAmountSpent = v.InstacartActivityMetadata.TotalOrderAmountSpent - retval.DateOrdered = v.InstacartActivityMetadata.DateOrdered - retval.DateDelivered = v.InstacartActivityMetadata.DateDelivered - retval.StatusString = v.InstacartActivityMetadata.StatusString - retval.Items = v.InstacartActivityMetadata.Items - return &retval, nil -} - -// LookupActivityMetadataNetflixActivityMetadata includes the requested fields of the GraphQL type NetflixActivityMetadata. -type LookupActivityMetadataNetflixActivityMetadata struct { - Typename string `json:"__typename"` - NetflixActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataNetflixActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataNetflixActivityMetadata) GetTypename() string { return v.Typename } - -// GetTitle returns LookupActivityMetadataNetflixActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataNetflixActivityMetadata) GetTitle() string { - return v.NetflixActivityMetadata.Title -} - -// GetSubject returns LookupActivityMetadataNetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataNetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { - return v.NetflixActivityMetadata.Subject -} - -// GetDate returns LookupActivityMetadataNetflixActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataNetflixActivityMetadata) GetDate() graphqlTypes.Date { - return v.NetflixActivityMetadata.Date -} - -// GetLastPlayedAt returns LookupActivityMetadataNetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataNetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { - return v.NetflixActivityMetadata.LastPlayedAt -} - -func (v *LookupActivityMetadataNetflixActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataNetflixActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataNetflixActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.NetflixActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataNetflixActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -func (v *LookupActivityMetadataNetflixActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataNetflixActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataNetflixActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataNetflixActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.NetflixActivityMetadata.Title - retval.Subject = v.NetflixActivityMetadata.Subject - retval.Date = v.NetflixActivityMetadata.Date - retval.LastPlayedAt = v.NetflixActivityMetadata.LastPlayedAt - return &retval, nil -} - -// LookupActivityMetadataPlaystationActivityMetadata includes the requested fields of the GraphQL type PlaystationActivityMetadata. -type LookupActivityMetadataPlaystationActivityMetadata struct { - Typename string `json:"__typename"` - PlaystationActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataPlaystationActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataPlaystationActivityMetadata) GetTypename() string { return v.Typename } - -// GetTitle returns LookupActivityMetadataPlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataPlaystationActivityMetadata) GetTitle() string { - return v.PlaystationActivityMetadata.Title -} - -// GetSubject returns LookupActivityMetadataPlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataPlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { - return v.PlaystationActivityMetadata.Subject -} - -// GetLastPlayedAt returns LookupActivityMetadataPlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataPlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { - return v.PlaystationActivityMetadata.LastPlayedAt -} - -func (v *LookupActivityMetadataPlaystationActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataPlaystationActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataPlaystationActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.PlaystationActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataPlaystationActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` - - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -func (v *LookupActivityMetadataPlaystationActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataPlaystationActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataPlaystationActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataPlaystationActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.PlaystationActivityMetadata.Title - retval.Subject = v.PlaystationActivityMetadata.Subject - retval.LastPlayedAt = v.PlaystationActivityMetadata.LastPlayedAt - return &retval, nil -} - -// LookupActivityMetadataUberActivityMetadata includes the requested fields of the GraphQL type UberActivityMetadata. -type LookupActivityMetadataUberActivityMetadata struct { - Typename string `json:"__typename"` - UberActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataUberActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataUberActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { - return v.UberActivityMetadata.Subject -} - -// GetBeginTripTime returns LookupActivityMetadataUberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetBeginTripTime() time.Time { - return v.UberActivityMetadata.BeginTripTime -} - -// GetDropoffTime returns LookupActivityMetadataUberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetDropoffTime() time.Time { - return v.UberActivityMetadata.DropoffTime -} - -// GetCost returns LookupActivityMetadataUberActivityMetadata.Cost, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetCost() string { - return v.UberActivityMetadata.Cost -} - -// GetCity returns LookupActivityMetadataUberActivityMetadata.City, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetCity() string { - return v.UberActivityMetadata.City -} - -// GetDistance returns LookupActivityMetadataUberActivityMetadata.Distance, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetDistance() string { - return v.UberActivityMetadata.Distance -} - -// GetStatus returns LookupActivityMetadataUberActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberActivityMetadata) GetStatus() TripStatus { - return v.UberActivityMetadata.Status -} - -func (v *LookupActivityMetadataUberActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataUberActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataUberActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataUberActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` - - BeginTripTime time.Time `json:"beginTripTime"` - - DropoffTime time.Time `json:"dropoffTime"` - - Cost string `json:"cost"` - - City string `json:"city"` - - Distance string `json:"distance"` - - Status TripStatus `json:"status"` -} - -func (v *LookupActivityMetadataUberActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataUberActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataUberActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataUberActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberActivityMetadata.Subject - retval.BeginTripTime = v.UberActivityMetadata.BeginTripTime - retval.DropoffTime = v.UberActivityMetadata.DropoffTime - retval.Cost = v.UberActivityMetadata.Cost - retval.City = v.UberActivityMetadata.City - retval.Distance = v.UberActivityMetadata.Distance - retval.Status = v.UberActivityMetadata.Status - return &retval, nil -} - -// LookupActivityMetadataUberEatsActivityMetadata includes the requested fields of the GraphQL type UberEatsActivityMetadata. -type LookupActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - UberEatsActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataUberEatsActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTypename() string { return v.Typename } - -// GetSubject returns LookupActivityMetadataUberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.UberEatsActivityMetadata.Subject -} - -// GetDate returns LookupActivityMetadataUberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetDate() graphqlTypes.Date { - return v.UberEatsActivityMetadata.Date -} - -// GetRestaurant returns LookupActivityMetadataUberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetRestaurant() string { - return v.UberEatsActivityMetadata.Restaurant -} - -// GetCurrency returns LookupActivityMetadataUberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetCurrency() string { - return v.UberEatsActivityMetadata.Currency -} - -// GetTotalPrice returns LookupActivityMetadataUberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetTotalPrice() float64 { - return v.UberEatsActivityMetadata.TotalPrice -} - -// GetUberEatsActivityMetadataStatus returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus -} - -// GetUberEatsActivityMetadataItems returns LookupActivityMetadataUberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataUberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { - return v.UberEatsActivityMetadata.UberEatsActivityMetadataItems -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataUberEatsActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataUberEatsActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.UberEatsActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataUberEatsActivityMetadata struct { - Typename string `json:"__typename"` - - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - Restaurant string `json:"restaurant"` - - Currency string `json:"currency"` - - TotalPrice float64 `json:"totalPrice"` - - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - - UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataUberEatsActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataUberEatsActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataUberEatsActivityMetadata - - retval.Typename = v.Typename - retval.Subject = v.UberEatsActivityMetadata.Subject - retval.Date = v.UberEatsActivityMetadata.Date - retval.Restaurant = v.UberEatsActivityMetadata.Restaurant - retval.Currency = v.UberEatsActivityMetadata.Currency - retval.TotalPrice = v.UberEatsActivityMetadata.TotalPrice - retval.UberEatsActivityMetadataStatus = v.UberEatsActivityMetadata.UberEatsActivityMetadataStatus - retval.UberEatsActivityMetadataItems = v.UberEatsActivityMetadata.UberEatsActivityMetadataItems - return &retval, nil -} - -// LookupActivityMetadataYoutubeActivityMetadata includes the requested fields of the GraphQL type YoutubeActivityMetadata. -type LookupActivityMetadataYoutubeActivityMetadata struct { - Typename string `json:"__typename"` - YoutubeActivityMetadata `json:"-"` -} - -// GetTypename returns LookupActivityMetadataYoutubeActivityMetadata.Typename, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetTypename() string { return v.Typename } - -// GetTitle returns LookupActivityMetadataYoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetTitle() string { - return v.YoutubeActivityMetadata.Title -} - -// GetSubject returns LookupActivityMetadataYoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { - return v.YoutubeActivityMetadata.Subject -} - -// GetDate returns LookupActivityMetadataYoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetDate() graphqlTypes.Date { - return v.YoutubeActivityMetadata.Date -} - -// GetPercentageWatched returns LookupActivityMetadataYoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetPercentageWatched() int { - return v.YoutubeActivityMetadata.PercentageWatched -} - -// GetContentType returns LookupActivityMetadataYoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. -func (v *LookupActivityMetadataYoutubeActivityMetadata) GetContentType() ContentType { - return v.YoutubeActivityMetadata.ContentType -} - -func (v *LookupActivityMetadataYoutubeActivityMetadata) UnmarshalJSON(b []byte) error { - - if string(b) == "null" { - return nil - } - - var firstPass struct { - *LookupActivityMetadataYoutubeActivityMetadata - graphql.NoUnmarshalJSON - } - firstPass.LookupActivityMetadataYoutubeActivityMetadata = v - - err := json.Unmarshal(b, &firstPass) - if err != nil { - return err - } - - err = json.Unmarshal( - b, &v.YoutubeActivityMetadata) - if err != nil { - return err - } - return nil -} - -type __premarshalLookupActivityMetadataYoutubeActivityMetadata struct { - Typename string `json:"__typename"` - - Title string `json:"title"` - - Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` - - Date graphqlTypes.Date `json:"date"` - - PercentageWatched int `json:"percentageWatched"` - - ContentType ContentType `json:"contentType"` -} - -func (v *LookupActivityMetadataYoutubeActivityMetadata) MarshalJSON() ([]byte, error) { - premarshaled, err := v.__premarshalJSON() - if err != nil { - return nil, err - } - return json.Marshal(premarshaled) -} - -func (v *LookupActivityMetadataYoutubeActivityMetadata) __premarshalJSON() (*__premarshalLookupActivityMetadataYoutubeActivityMetadata, error) { - var retval __premarshalLookupActivityMetadataYoutubeActivityMetadata - - retval.Typename = v.Typename - retval.Title = v.YoutubeActivityMetadata.Title - retval.Subject = v.YoutubeActivityMetadata.Subject - retval.Date = v.YoutubeActivityMetadata.Date - retval.PercentageWatched = v.YoutubeActivityMetadata.PercentageWatched - retval.ContentType = v.YoutubeActivityMetadata.ContentType - return &retval, nil -} - -// LookupTrait includes the requested fields of the GraphQL type Trait. -type LookupTrait struct { - Id uuid.UUID `json:"id"` - Source Source `json:"source"` - Label TraitLabel `json:"label"` - Value string `json:"value"` - Timestamp time.Time `json:"timestamp"` -} - -// GetId returns LookupTrait.Id, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetId() uuid.UUID { return v.Id } - -// GetSource returns LookupTrait.Source, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetSource() Source { return v.Source } - -// GetLabel returns LookupTrait.Label, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetLabel() TraitLabel { return v.Label } - -// GetValue returns LookupTrait.Value, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetValue() string { return v.Value } - -// GetTimestamp returns LookupTrait.Timestamp, and is useful for accessing the field via an interface. -func (v *LookupTrait) GetTimestamp() time.Time { return v.Timestamp } - -// NetflixActivityMetadata includes the GraphQL fields of NetflixActivityMetadata requested by the fragment NetflixActivityMetadata. -type NetflixActivityMetadata struct { - Title string `json:"title"` - Subject []NetflixActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -// GetTitle returns NetflixActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadata) GetTitle() string { return v.Title } - -// GetSubject returns NetflixActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadata) GetSubject() []NetflixActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetDate returns NetflixActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } - -// GetLastPlayedAt returns NetflixActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { return v.LastPlayedAt } - -// NetflixActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type NetflixActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns NetflixActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns NetflixActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *NetflixActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -// PlaystationActivityMetadata includes the GraphQL fields of PlaystationActivityMetadata requested by the fragment PlaystationActivityMetadata. -type PlaystationActivityMetadata struct { - Title string `json:"title"` - Subject []PlaystationActivityMetadataSubjectIdentifier `json:"subject"` - LastPlayedAt graphqlTypes.Date `json:"lastPlayedAt"` -} - -// GetTitle returns PlaystationActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *PlaystationActivityMetadata) GetTitle() string { return v.Title } - -// GetSubject returns PlaystationActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *PlaystationActivityMetadata) GetSubject() []PlaystationActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetLastPlayedAt returns PlaystationActivityMetadata.LastPlayedAt, and is useful for accessing the field via an interface. -func (v *PlaystationActivityMetadata) GetLastPlayedAt() graphqlTypes.Date { return v.LastPlayedAt } - -// PlaystationActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type PlaystationActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns PlaystationActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *PlaystationActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns PlaystationActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *PlaystationActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -type Source string - -const ( - SourceNetflix Source = "NETFLIX" - SourcePlaystation Source = "PLAYSTATION" - SourceYoutube Source = "YOUTUBE" - SourceAmazon Source = "AMAZON" - SourceUber Source = "UBER" - SourceBooking Source = "BOOKING" - SourceInstacart Source = "INSTACART" - SourceInstagram Source = "INSTAGRAM" - SourceX Source = "X" - SourceUbereats Source = "UBEREATS" - SourceGandalf Source = "GANDALF" -) - -type TraitLabel string - -const ( - TraitLabelPrimeSubscriber TraitLabel = "PRIME_SUBSCRIBER" - TraitLabelRating TraitLabel = "RATING" - TraitLabelTripCount TraitLabel = "TRIP_COUNT" - TraitLabelAccountCreatedOn TraitLabel = "ACCOUNT_CREATED_ON" - TraitLabelPlan TraitLabel = "PLAN" - TraitLabelGeniusLevel TraitLabel = "GENIUS_LEVEL" - TraitLabelFollowerCount TraitLabel = "FOLLOWER_COUNT" - TraitLabelFollowingCount TraitLabel = "FOLLOWING_COUNT" - TraitLabelUsername TraitLabel = "USERNAME" - TraitLabelPostCount TraitLabel = "POST_COUNT" - TraitLabelEmail TraitLabel = "EMAIL" - TraitLabelOrderCount TraitLabel = "ORDER_COUNT" -) - -type TripStatus string - -const ( - TripStatusCanceled TripStatus = "CANCELED" - TripStatusCompleted TripStatus = "COMPLETED" - TripStatusUnfulfilled TripStatus = "UNFULFILLED" -) - -// UberActivityMetadata includes the GraphQL fields of UberActivityMetadata requested by the fragment UberActivityMetadata. -type UberActivityMetadata struct { - Subject []UberActivityMetadataSubjectIdentifier `json:"subject"` - BeginTripTime time.Time `json:"beginTripTime"` - DropoffTime time.Time `json:"dropoffTime"` - Cost string `json:"cost"` - City string `json:"city"` - Distance string `json:"distance"` - Status TripStatus `json:"status"` -} - -// GetSubject returns UberActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetSubject() []UberActivityMetadataSubjectIdentifier { return v.Subject } - -// GetBeginTripTime returns UberActivityMetadata.BeginTripTime, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetBeginTripTime() time.Time { return v.BeginTripTime } - -// GetDropoffTime returns UberActivityMetadata.DropoffTime, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetDropoffTime() time.Time { return v.DropoffTime } - -// GetCost returns UberActivityMetadata.Cost, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetCost() string { return v.Cost } - -// GetCity returns UberActivityMetadata.City, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetCity() string { return v.City } - -// GetDistance returns UberActivityMetadata.Distance, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetDistance() string { return v.Distance } - -// GetStatus returns UberActivityMetadata.Status, and is useful for accessing the field via an interface. -func (v *UberActivityMetadata) GetStatus() TripStatus { return v.Status } - -// UberActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type UberActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns UberActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *UberActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns UberActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *UberActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -// UberEatsActivityMetadata includes the GraphQL fields of UberEatsActivityMetadata requested by the fragment UberEatsActivityMetadata. -type UberEatsActivityMetadata struct { - Subject []UberEatsActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - Restaurant string `json:"restaurant"` - Currency string `json:"currency"` - TotalPrice float64 `json:"totalPrice"` - UberEatsActivityMetadataStatus UberEatsOrderStatus `json:"UberEatsActivityMetadataStatus"` - UberEatsActivityMetadataItems []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem `json:"UberEatsActivityMetadataItems"` -} - -// GetSubject returns UberEatsActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetSubject() []UberEatsActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetDate returns UberEatsActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } - -// GetRestaurant returns UberEatsActivityMetadata.Restaurant, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetRestaurant() string { return v.Restaurant } - -// GetCurrency returns UberEatsActivityMetadata.Currency, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetCurrency() string { return v.Currency } - -// GetTotalPrice returns UberEatsActivityMetadata.TotalPrice, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetTotalPrice() float64 { return v.TotalPrice } - -// GetUberEatsActivityMetadataStatus returns UberEatsActivityMetadata.UberEatsActivityMetadataStatus, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataStatus() UberEatsOrderStatus { - return v.UberEatsActivityMetadataStatus -} - -// GetUberEatsActivityMetadataItems returns UberEatsActivityMetadata.UberEatsActivityMetadataItems, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadata) GetUberEatsActivityMetadataItems() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem { - return v.UberEatsActivityMetadataItems -} - -// UberEatsActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type UberEatsActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns UberEatsActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns UberEatsActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -// UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem includes the requested fields of the GraphQL type UberEatsOrderItem. -type UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem struct { - Name string `json:"name"` - Price string `json:"price"` - QuantityPurchased graphqlTypes.Int64 `json:"quantityPurchased"` - Customizations []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations `json:"customizations"` -} - -// GetName returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Name, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetName() string { - return v.Name -} - -// GetPrice returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Price, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetPrice() string { - return v.Price -} - -// GetQuantityPurchased returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.QuantityPurchased, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetQuantityPurchased() graphqlTypes.Int64 { - return v.QuantityPurchased -} - -// GetCustomizations returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem.Customizations, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItem) GetCustomizations() []UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations { - return v.Customizations -} - -// UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations includes the requested fields of the GraphQL type UberEatsOrderItemCustomizations. -type UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations struct { - Customization string `json:"customization"` - Value string `json:"value"` - Quantity graphqlTypes.Int64 `json:"quantity"` -} - -// GetCustomization returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Customization, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetCustomization() string { - return v.Customization -} - -// GetValue returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Value, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetValue() string { - return v.Value -} - -// GetQuantity returns UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations.Quantity, and is useful for accessing the field via an interface. -func (v *UberEatsActivityMetadataUberEatsActivityMetadataItemsUberEatsOrderItemCustomizations) GetQuantity() graphqlTypes.Int64 { - return v.Quantity -} - -type UberEatsOrderStatus string - -const ( - UberEatsOrderStatusSuccess UberEatsOrderStatus = "SUCCESS" - UberEatsOrderStatusEaterCancelled UberEatsOrderStatus = "EATER_CANCELLED" - UberEatsOrderStatusRestaurantCancelled UberEatsOrderStatus = "RESTAURANT_CANCELLED" - UberEatsOrderStatusRestaurantUnfulfilled UberEatsOrderStatus = "RESTAURANT_UNFULFILLED" - UberEatsOrderStatusUnknown UberEatsOrderStatus = "UNKNOWN" -) - -// YoutubeActivityMetadata includes the GraphQL fields of YoutubeActivityMetadata requested by the fragment YoutubeActivityMetadata. -type YoutubeActivityMetadata struct { - Title string `json:"title"` - Subject []YoutubeActivityMetadataSubjectIdentifier `json:"subject"` - Date graphqlTypes.Date `json:"date"` - PercentageWatched int `json:"percentageWatched"` - ContentType ContentType `json:"contentType"` -} - -// GetTitle returns YoutubeActivityMetadata.Title, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadata) GetTitle() string { return v.Title } - -// GetSubject returns YoutubeActivityMetadata.Subject, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadata) GetSubject() []YoutubeActivityMetadataSubjectIdentifier { - return v.Subject -} - -// GetDate returns YoutubeActivityMetadata.Date, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadata) GetDate() graphqlTypes.Date { return v.Date } - -// GetPercentageWatched returns YoutubeActivityMetadata.PercentageWatched, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadata) GetPercentageWatched() int { return v.PercentageWatched } - -// GetContentType returns YoutubeActivityMetadata.ContentType, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadata) GetContentType() ContentType { return v.ContentType } - -// YoutubeActivityMetadataSubjectIdentifier includes the requested fields of the GraphQL type Identifier. -type YoutubeActivityMetadataSubjectIdentifier struct { - Value string `json:"value"` - IdentifierType IdentifierType `json:"identifierType"` -} - -// GetValue returns YoutubeActivityMetadataSubjectIdentifier.Value, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadataSubjectIdentifier) GetValue() string { return v.Value } - -// GetIdentifierType returns YoutubeActivityMetadataSubjectIdentifier.IdentifierType, and is useful for accessing the field via an interface. -func (v *YoutubeActivityMetadataSubjectIdentifier) GetIdentifierType() IdentifierType { - return v.IdentifierType -} - -// __getActivityInput is used internally by genqlient -type __getActivityInput struct { - DataKey string `json:"dataKey"` - ActivityType []ActivityType `json:"activityType"` - Source Source `json:"source"` - Limit graphqlTypes.Int64 `json:"limit"` - Page graphqlTypes.Int64 `json:"page"` -} - -// GetDataKey returns __getActivityInput.DataKey, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetDataKey() string { return v.DataKey } - -// GetActivityType returns __getActivityInput.ActivityType, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetActivityType() []ActivityType { return v.ActivityType } - -// GetSource returns __getActivityInput.Source, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetSource() Source { return v.Source } - -// GetLimit returns __getActivityInput.Limit, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetLimit() graphqlTypes.Int64 { return v.Limit } - -// GetPage returns __getActivityInput.Page, and is useful for accessing the field via an interface. -func (v *__getActivityInput) GetPage() graphqlTypes.Int64 { return v.Page } - -// __getAppByPublicKeyInput is used internally by genqlient -type __getAppByPublicKeyInput struct { - PublicKey string `json:"publicKey"` -} - -// GetPublicKey returns __getAppByPublicKeyInput.PublicKey, and is useful for accessing the field via an interface. -func (v *__getAppByPublicKeyInput) GetPublicKey() string { return v.PublicKey } - -// __getTraitsInput is used internally by genqlient -type __getTraitsInput struct { - DataKey string `json:"dataKey"` - Source Source `json:"source"` - Labels []TraitLabel `json:"labels"` -} - -// GetDataKey returns __getTraitsInput.DataKey, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetDataKey() string { return v.DataKey } - -// GetSource returns __getTraitsInput.Source, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetSource() Source { return v.Source } - -// GetLabels returns __getTraitsInput.Labels, and is useful for accessing the field via an interface. -func (v *__getTraitsInput) GetLabels() []TraitLabel { return v.Labels } - -// __lookupActivityInput is used internally by genqlient -type __lookupActivityInput struct { - DataKey string `json:"dataKey"` - ActivityId uuid.UUID `json:"activityId"` -} - -// GetDataKey returns __lookupActivityInput.DataKey, and is useful for accessing the field via an interface. -func (v *__lookupActivityInput) GetDataKey() string { return v.DataKey } - -// GetActivityId returns __lookupActivityInput.ActivityId, and is useful for accessing the field via an interface. -func (v *__lookupActivityInput) GetActivityId() uuid.UUID { return v.ActivityId } - -// __lookupTraitInput is used internally by genqlient -type __lookupTraitInput struct { - DataKey string `json:"dataKey"` - TraitId uuid.UUID `json:"traitId"` -} - -// GetDataKey returns __lookupTraitInput.DataKey, and is useful for accessing the field via an interface. -func (v *__lookupTraitInput) GetDataKey() string { return v.DataKey } - -// GetTraitId returns __lookupTraitInput.TraitId, and is useful for accessing the field via an interface. -func (v *__lookupTraitInput) GetTraitId() uuid.UUID { return v.TraitId } - -// getActivityResponse is returned by getActivity on success. -type getActivityResponse struct { - GetActivity GetActivityActivityResponse `json:"getActivity"` -} - -// GetGetActivity returns getActivityResponse.GetActivity, and is useful for accessing the field via an interface. -func (v *getActivityResponse) GetGetActivity() GetActivityActivityResponse { return v.GetActivity } - -// getAppByPublicKeyResponse is returned by getAppByPublicKey on success. -type getAppByPublicKeyResponse struct { - GetAppByPublicKey GetAppByPublicKeyApplication `json:"getAppByPublicKey"` -} - -// GetGetAppByPublicKey returns getAppByPublicKeyResponse.GetAppByPublicKey, and is useful for accessing the field via an interface. -func (v *getAppByPublicKeyResponse) GetGetAppByPublicKey() GetAppByPublicKeyApplication { - return v.GetAppByPublicKey -} - -// getTraitsResponse is returned by getTraits on success. -type getTraitsResponse struct { - GetTraits []GetTraitsTrait `json:"getTraits"` -} - -// GetGetTraits returns getTraitsResponse.GetTraits, and is useful for accessing the field via an interface. -func (v *getTraitsResponse) GetGetTraits() []GetTraitsTrait { return v.GetTraits } - -// lookupActivityResponse is returned by lookupActivity on success. -type lookupActivityResponse struct { - LookupActivity LookupActivity `json:"lookupActivity"` -} - -// GetLookupActivity returns lookupActivityResponse.LookupActivity, and is useful for accessing the field via an interface. -func (v *lookupActivityResponse) GetLookupActivity() LookupActivity { return v.LookupActivity } - -// lookupTraitResponse is returned by lookupTrait on success. -type lookupTraitResponse struct { - LookupTrait LookupTrait `json:"lookupTrait"` -} - -// GetLookupTrait returns lookupTraitResponse.LookupTrait, and is useful for accessing the field via an interface. -func (v *lookupTraitResponse) GetLookupTrait() LookupTrait { return v.LookupTrait } - -// The query or mutation executed by getActivity. -const getActivity_Operation = ` -query getActivity ($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { - getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { - ... on ActivityResponse { - data { - ... on Activity { - id - metadata { - __typename - ... NetflixActivityMetadata - ... PlaystationActivityMetadata - ... AmazonActivityMetadata - ... BookingActivityMetadata - ... YoutubeActivityMetadata - ... UberActivityMetadata - ... InstacartActivityMetadata - ... UberEatsActivityMetadata - } - } - } - limit - total - page - } - } -} -fragment NetflixActivityMetadata on NetflixActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - date - lastPlayedAt -} -fragment PlaystationActivityMetadata on PlaystationActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - lastPlayedAt -} -fragment AmazonActivityMetadata on AmazonActivityMetadata { - productName - subject { - ... on Identifier { - value - identifierType - } - } - date - quantityPurchased - totalCost -} -fragment BookingActivityMetadata on BookingActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - bookingID - price - bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType - } - } -} -fragment YoutubeActivityMetadata on YoutubeActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - date - percentageWatched - contentType -} -fragment UberActivityMetadata on UberActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - beginTripTime - dropoffTime - cost - city - distance - status -} -fragment InstacartActivityMetadata on InstacartActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - retailer - totalOrderAmountSpent - dateOrdered - dateDelivered - statusString - items { - ... on InstacartOrderItem { - itemID - productName - unitPrice - status - quantityPurchased - } - } -} -fragment UberEatsActivityMetadata on UberEatsActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - date - restaurant - currency - totalPrice - UberEatsActivityMetadataStatus: status - UberEatsActivityMetadataItems: items { - ... on UberEatsOrderItem { - name - price - quantityPurchased - customizations { - ... on UberEatsOrderItemCustomizations { - customization - value - quantity - } - } - } - } -} -` - -func (eye EyeOfSauron) GetActivity( - ctx_ context.Context, - dataKey string, - activityType []ActivityType, - source Source, - limit graphqlTypes.Int64, - page graphqlTypes.Int64, -) (*getActivityResponse, error) { - req := graphql2.NewRequest(getActivity_Operation) - - req.Var("dataKey", dataKey) - req.Var("activityType", activityType) - req.Var("source", source) - req.Var("limit", limit) - req.Var("page", page) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ getActivityResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} - -// The query or mutation executed by getAppByPublicKey. -const getAppByPublicKey_Operation = ` -query getAppByPublicKey ($publicKey: String!) { - getAppByPublicKey(publicKey: $publicKey) { - ... on Application { - appName - publicKey - iconURL - gandalfID - appRegistrar - } - } -} -` - -func (eye EyeOfSauron) GetAppByPublicKey( - ctx_ context.Context, - publicKey string, -) (*getAppByPublicKeyResponse, error) { - req := graphql2.NewRequest(getAppByPublicKey_Operation) - - req.Var("publicKey", publicKey) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ getAppByPublicKeyResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} - -// The query or mutation executed by getTraits. -const getTraits_Operation = ` -query getTraits ($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { - getTraits(dataKey: $dataKey, source: $source, labels: $labels) { - ... on Trait { - id - source - label - value - timestamp - } - } -} -` - -func (eye EyeOfSauron) GetTraits( - ctx_ context.Context, - dataKey string, - source Source, - labels []TraitLabel, -) (*getTraitsResponse, error) { - req := graphql2.NewRequest(getTraits_Operation) - - req.Var("dataKey", dataKey) - req.Var("source", source) - req.Var("labels", labels) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ getTraitsResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} - -// The query or mutation executed by lookupActivity. -const lookupActivity_Operation = ` -query lookupActivity ($dataKey: String!, $activityId: UUID!) { - lookupActivity(dataKey: $dataKey, activityId: $activityId) { - ... on Activity { - id - metadata { - __typename - ... NetflixActivityMetadata - ... PlaystationActivityMetadata - ... AmazonActivityMetadata - ... BookingActivityMetadata - ... YoutubeActivityMetadata - ... UberActivityMetadata - ... InstacartActivityMetadata - ... UberEatsActivityMetadata - } - } - } -} -fragment NetflixActivityMetadata on NetflixActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - date - lastPlayedAt -} -fragment PlaystationActivityMetadata on PlaystationActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - lastPlayedAt -} -fragment AmazonActivityMetadata on AmazonActivityMetadata { - productName - subject { - ... on Identifier { - value - identifierType - } - } - date - quantityPurchased - totalCost -} -fragment BookingActivityMetadata on BookingActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - bookingID - price - bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType - } - } -} -fragment YoutubeActivityMetadata on YoutubeActivityMetadata { - title - subject { - ... on Identifier { - value - identifierType - } - } - date - percentageWatched - contentType -} -fragment UberActivityMetadata on UberActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - beginTripTime - dropoffTime - cost - city - distance - status -} -fragment InstacartActivityMetadata on InstacartActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - retailer - totalOrderAmountSpent - dateOrdered - dateDelivered - statusString - items { - ... on InstacartOrderItem { - itemID - productName - unitPrice - status - quantityPurchased - } - } -} -fragment UberEatsActivityMetadata on UberEatsActivityMetadata { - subject { - ... on Identifier { - value - identifierType - } - } - date - restaurant - currency - totalPrice - UberEatsActivityMetadataStatus: status - UberEatsActivityMetadataItems: items { - ... on UberEatsOrderItem { - name - price - quantityPurchased - customizations { - ... on UberEatsOrderItemCustomizations { - customization - value - quantity - } - } - } - } -} -` - -func (eye EyeOfSauron) LookupActivity( - ctx_ context.Context, - dataKey string, - activityId uuid.UUID, -) (*lookupActivityResponse, error) { - req := graphql2.NewRequest(lookupActivity_Operation) - - req.Var("dataKey", dataKey) - req.Var("activityId", activityId) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ lookupActivityResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} - -// The query or mutation executed by lookupTrait. -const lookupTrait_Operation = ` -query lookupTrait ($dataKey: String!, $traitId: UUID!) { - lookupTrait(dataKey: $dataKey, traitId: $traitId) { - ... on Trait { - id - source - label - value - timestamp - } - } -} -` - -func (eye EyeOfSauron) LookupTrait( - ctx_ context.Context, - dataKey string, - traitId uuid.UUID, -) (*lookupTraitResponse, error) { - req := graphql2.NewRequest(lookupTrait_Operation) - - req.Var("dataKey", dataKey) - req.Var("traitId", traitId) - requestBodyObj := struct { - Query string `json:"query"` - Variables map[string]interface{} `json:"variables"` - }{ - Query: req.Query(), - Variables: req.Vars(), - } - - var requestBody bytes.Buffer - if err := json.NewEncoder(&requestBody).Encode(requestBodyObj); err != nil { - return nil, fmt.Errorf("unable to encode body %s", err) - } - - var err_ error - signatureB64, err_ := SignMessageAsBase64(eye.privateKey, requestBody.Bytes()) - if err_ != nil { - return nil, fmt.Errorf("unable to generate signature: %v", err_) - } - - req.Header.Set("X-Gandalf-Signature", signatureB64) - - var resp_ lookupTraitResponse - - if err_ := eye.client.Run( - ctx_, - req, - &resp_, - ); err_ != nil { - return nil, fmt.Errorf("failed to execute request: %v", err_) - } - - return &resp_, nil -} diff --git a/example/generated/genqlient.graphql b/example/generated/genqlient.graphql deleted file mode 100644 index 2f7d0c6..0000000 --- a/example/generated/genqlient.graphql +++ /dev/null @@ -1,216 +0,0 @@ -fragment PlaystationActivityMetadata on PlaystationActivityMetadata { - title: title - subject: subject { - ... on Identifier { - value - identifierType - } - } - lastPlayedAt: lastPlayedAt -} - -fragment AmazonActivityMetadata on AmazonActivityMetadata { - productName: productName - subject: subject { - ... on Identifier { - value - identifierType - } - } - date: date - quantityPurchased: quantityPurchased - totalCost: totalCost -} - -fragment NetflixActivityMetadata on NetflixActivityMetadata { - title: title - subject: subject { - ... on Identifier { - value - identifierType - } - } - date: date - lastPlayedAt: lastPlayedAt -} - -fragment UberActivityMetadata on UberActivityMetadata { - subject: subject { - ... on Identifier { - value - identifierType - } - } - beginTripTime: beginTripTime - dropoffTime: dropoffTime - cost: cost - city: city - distance: distance - status: status -} - -fragment YoutubeActivityMetadata on YoutubeActivityMetadata { - title: title - subject: subject { - ... on Identifier { - value - identifierType - } - } - date: date - percentageWatched: percentageWatched - contentType: contentType -} - -fragment BookingActivityMetadata on BookingActivityMetadata { - subject: subject { - ... on Identifier { - value - identifierType - } - } - bookingID: bookingID - price: price - bookings: bookings { - ... on BookingItem { - startDateTime - endDateTime - address - depatureLocation - arrivalLocation - layoverLocations - activityType - } - } -} - -fragment InstacartActivityMetadata on InstacartActivityMetadata { - subject: subject { - ... on Identifier { - value - identifierType - } - } - retailer: retailer - totalOrderAmountSpent: totalOrderAmountSpent - dateOrdered: dateOrdered - dateDelivered: dateDelivered - statusString: statusString - items: items { - ... on InstacartOrderItem { - itemID - productName - unitPrice - status - quantityPurchased - } - } -} - -fragment UberEatsActivityMetadata on UberEatsActivityMetadata { - subject: subject { - ... on Identifier { - value - identifierType - } - } - date: date - restaurant: restaurant - currency: currency - totalPrice: totalPrice - UberEatsActivityMetadataStatus: status - UberEatsActivityMetadataItems: items { - ... on UberEatsOrderItem { - name - price - quantityPurchased - customizations { - ... on UberEatsOrderItemCustomizations { - customization - value - quantity - } - } - } - } -} - -query getActivity($dataKey: String!, $activityType: [ActivityType], $source: Source!, $limit: Int64!, $page: Int64!) { - getActivity(dataKey: $dataKey, activityType: $activityType, source: $source, limit: $limit, page: $page) { - ... on ActivityResponse { - data { - ... on Activity { - id - metadata { - ...NetflixActivityMetadata - ...PlaystationActivityMetadata - ...AmazonActivityMetadata - ...BookingActivityMetadata - ...YoutubeActivityMetadata - ...UberActivityMetadata - ...InstacartActivityMetadata - ...UberEatsActivityMetadata - } - } - } - limit - total - page - } - } -} - -query lookupActivity($dataKey: String!, $activityId: UUID!) { - lookupActivity(dataKey: $dataKey, activityId: $activityId) { - ... on Activity { - id - metadata { - ...NetflixActivityMetadata - ...PlaystationActivityMetadata - ...AmazonActivityMetadata - ...BookingActivityMetadata - ...YoutubeActivityMetadata - ...UberActivityMetadata - ...InstacartActivityMetadata - ...UberEatsActivityMetadata - } - } - } -} - -query getAppByPublicKey($publicKey: String!) { - getAppByPublicKey(publicKey: $publicKey) { - ... on Application { - appName - publicKey - iconURL - gandalfID - appRegistrar - } - } -} - -query getTraits($dataKey: String!, $source: Source!, $labels: [TraitLabel]!) { - getTraits(dataKey: $dataKey, source: $source, labels: $labels) { - ... on Trait { - id - source - label - value - timestamp - } - } -} - -query lookupTrait($dataKey: String!, $traitId: UUID!) { - lookupTrait(dataKey: $dataKey, traitId: $traitId) { - ... on Trait { - id - source - label - value - timestamp - } - } -} - diff --git a/example/generated/genqlient.yaml b/example/generated/genqlient.yaml deleted file mode 100644 index 18dc746..0000000 --- a/example/generated/genqlient.yaml +++ /dev/null @@ -1,14 +0,0 @@ - -schema: schema.graphql -operations: -- genqlient.graphql -generated: generated.go -bindings: - Int64: - type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Int64 - Date: - type: github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/graphqlTypes.Date - UUID: - type: github.com/google/uuid.UUID - Time: - type: time.Time diff --git a/example/generated/schema.graphql b/example/generated/schema.graphql deleted file mode 100644 index e99bd5e..0000000 --- a/example/generated/schema.graphql +++ /dev/null @@ -1,247 +0,0 @@ -type Activity { - id: String! - metadata: ActivityMetadata! -} - -interface ActivityMetadata { - subject: [Identifier] -} - -type ActivityResponse { - data: [Activity]! - limit: Int64! - total: Int64! - page: Int64! -} - -enum ActivityType { - TRIP - STAY - SHOP - PLAY - WATCH -} - -type AmazonActivityMetadata implements ActivityMetadata { - productName: String! - subject: [Identifier] - date: Date - quantityPurchased: Int! - totalCost: String! -} - -type Application { - appName: String! - publicKey: String! - iconURL: String! - gandalfID: Int64! - appRegistrar: String! -} - -type BookingActivityMetadata implements ActivityMetadata { - subject: [Identifier] - bookingID: String! - price: String! - bookings: [BookingItem]! -} - -type BookingItem { - startDateTime: Time! - endDateTime: Time! - address: String! - depatureLocation: String! - arrivalLocation: String! - layoverLocations: [String]! - activityType: ActivityType! -} - -scalar Boolean - -enum ContentType { - VIDEO - SHORTS - MUSIC -} - -scalar Date - -scalar Float - -scalar ID - -type Identifier { - value: String! - identifierType: IdentifierType! -} - -enum IdentifierType { - IMDB - MOBY - RAWG - IGDB - ASIN - PLAYSTATION - YOUTUBE - TVDB - TVMAZE - UBER - BOOKING - INSTACART - UBEREATS -} - -type InstacartActivityMetadata implements ActivityMetadata { - subject: [Identifier] - retailer: String! - totalOrderAmountSpent: String! - dateOrdered: Date! - dateDelivered: Date! - statusString: String! - items: [InstacartOrderItem]! -} - -enum InstacartItemStatus { - FOUND - REPLACED - TOREFUND -} - -type InstacartOrderItem { - itemID: String! - productName: String! - unitPrice: String! - status: InstacartItemStatus! - quantityPurchased: Int64! -} - -enum InstacartOrderStatus { - COMPLETE -} - -scalar Int - -scalar Int64 - -scalar JSON - -scalar Map - -type NetflixActivityMetadata implements ActivityMetadata { - title: String! - subject: [Identifier] - date: Date - lastPlayedAt: Date -} - -type PlaystationActivityMetadata implements ActivityMetadata { - title: String! - subject: [Identifier] - lastPlayedAt: Date -} - -type Query { - getActivity(dataKey: String!, activityType: [ActivityType], source: Source!, limit: Int64!, page: Int64!): ActivityResponse! - lookupActivity(dataKey: String!, activityId: UUID!): Activity! - getAppByPublicKey(publicKey: String!): Application! - getTraits(dataKey: String!, source: Source!, labels: [TraitLabel]!): [Trait]! - lookupTrait(dataKey: String!, traitId: UUID!): Trait! -} - -enum Source { - NETFLIX - PLAYSTATION - YOUTUBE - AMAZON - UBER - BOOKING - INSTACART - INSTAGRAM - X - UBEREATS - GANDALF -} - -scalar String - -scalar Time - -type Trait { - id: UUID! - source: Source! - label: TraitLabel! - value: String! - timestamp: Time! -} - -enum TraitLabel { - PRIME_SUBSCRIBER - RATING - TRIP_COUNT - ACCOUNT_CREATED_ON - PLAN - GENIUS_LEVEL - FOLLOWER_COUNT - FOLLOWING_COUNT - USERNAME - POST_COUNT - EMAIL - ORDER_COUNT -} - -enum TripStatus { - CANCELED - COMPLETED - UNFULFILLED -} - -scalar UUID - -type UberActivityMetadata implements ActivityMetadata { - subject: [Identifier] - beginTripTime: Time! - dropoffTime: Time - cost: String! - city: String! - distance: String! - status: TripStatus! -} - -type UberEatsActivityMetadata implements ActivityMetadata { - subject: [Identifier] - date: Date - restaurant: String! - currency: String! - totalPrice: Float! - status: UberEatsOrderStatus! - items: [UberEatsOrderItem]! -} - -type UberEatsOrderItem { - name: String! - price: String! - quantityPurchased: Int64! - customizations: [UberEatsOrderItemCustomizations]! -} - -type UberEatsOrderItemCustomizations { - customization: String! - value: String! - quantity: Int64! -} - -enum UberEatsOrderStatus { - SUCCESS - EATER_CANCELLED - RESTAURANT_CANCELLED - RESTAURANT_UNFULFILLED - UNKNOWN -} - -type YoutubeActivityMetadata implements ActivityMetadata { - title: String! - subject: [Identifier] - date: Date - percentageWatched: Int! - contentType: ContentType! -} - From 640f62fdbe971fb955063546a0263657be1b794f Mon Sep 17 00:00:00 2001 From: Bashorun97 Date: Sat, 15 Jun 2024 15:23:36 +0000 Subject: [PATCH 14/14] Update docs Signed-off-by: Bashorun97 --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 99d518c..bae3e04 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,11 @@ import ( "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/generated" ) -func getActivity() { +func main() { + // initialize eyeofsauron object + ... + + // Get activity response, err := eye.GetActivity( context.Background(), @@ -128,7 +132,10 @@ import ( "github.com/gandalf-network/gandalf-sdk-go/eyeofsauron/generated" ) -func lookupActivity() { +func main() { + // initialize eyeofsauron object + ... + // Lookup activity response, err := eye.LookupActivity( context.Background(), @@ -178,6 +185,9 @@ func printJSON(v interface{}) { ### Get Traits ```go func main() { + // initialize eyeofsauron object + ... + response, err := eye.GetTraits(context.Background(), "MY_DATA_KEY", generated.SourceNetflix, []generated.TraitLabel{generated.TraitLabelPlan}) if err != nil { log.Fatalf("failed to get traits: %s", err) @@ -189,7 +199,10 @@ func main() { ### Lookup Traits ```go -func lookupTraits() { +func main() { + // initialize eyeofsauron object + ... + traitID, err := uuid.Parse("MY_TRAIT_ID") if err != nil { log.Fatalf("failed to parse string to uuid")