y2

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

README

Y2 Go API Library

Go Reference

The Y2 Go library provides convenient access to the Y2 REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/y2-intel/y2-go" // imported as y2
)

Or to pin the version:

go get -u 'github.com/y2-intel/[email protected]'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/y2-intel/y2-go"
	"github.com/y2-intel/y2-go/option"
)

func main() {
	client := y2.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("Y2_API_KEY")
	)
	reports, err := client.Reports.List(context.TODO(), y2.ReportListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", reports.Data)
}

Request fields

The y2 library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, y2.String(string), y2.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := y2.ExampleParams{
	ID:   "id_xxx",         // required property
	Name: y2.String("..."), // optional property

	Point: y2.Point{
		X: 0,         // required field will serialize as 0
		Y: y2.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: y2.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[y2.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := y2.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Reports.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *y2.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Reports.List(context.TODO(), y2.ReportListParams{})
if err != nil {
	var apierr *y2.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/reports": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Reports.List(
	ctx,
	y2.ReportListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper y2.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := y2.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Reports.List(
	context.TODO(),
	y2.ReportListParams{},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
reports, err := client.Reports.List(
	context.TODO(),
	y2.ReportListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", reports)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: y2.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := y2.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (Y2_API_KEY, Y2_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type AudioMetadata

type AudioMetadata struct {
	// Duration in seconds
	Duration float64 `json:"duration"`
	// Duration as HH:MM:SS
	DurationFormatted string `json:"durationFormatted"`
	// File size in bytes
	FileSize int64 `json:"fileSize"`
	// Any of "mp3".
	Format AudioMetadataFormat `json:"format"`
	// Any of "audio/mpeg".
	MimeType AudioMetadataMimeType `json:"mimeType"`
	// Convex storage ID for internal reference
	StorageID string `json:"storageId"`
	// CDN URL for audio file
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration          respjson.Field
		DurationFormatted respjson.Field
		FileSize          respjson.Field
		Format            respjson.Field
		MimeType          respjson.Field
		StorageID         respjson.Field
		URL               respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AudioMetadata) RawJSON

func (r AudioMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*AudioMetadata) UnmarshalJSON

func (r *AudioMetadata) UnmarshalJSON(data []byte) error

type AudioMetadataFormat

type AudioMetadataFormat string
const (
	AudioMetadataFormatMP3 AudioMetadataFormat = "mp3"
)

type AudioMetadataMimeType

type AudioMetadataMimeType string
const (
	AudioMetadataMimeTypeAudioMpeg AudioMetadataMimeType = "audio/mpeg"
)

type Client

type Client struct {
	Options  []option.RequestOption
	Reports  ReportService
	Profiles ProfileService
	News     NewsService
}

Client creates a struct with services and top level methods that help with interacting with the y2 API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (Y2_API_KEY, Y2_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type Error

type Error = apierror.Error

type NewsGetRecapsParams

type NewsGetRecapsParams struct {
	// Comma-separated list of topics. Valid topics: ai, ai_agents, aptos, base,
	// bitcoin, crypto, dats, defi, ethereum, hyperliquid, machine_learning, macro,
	// ondo, perps, ripple, rwa, solana, tech, virtuals
	Topics param.Opt[string] `query:"topics,omitzero" json:"-"`
	// Time period for recaps
	//
	// Any of "12h", "24h", "3d", "7d".
	Timeframe TimeframeEnum `query:"timeframe,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NewsGetRecapsParams) URLQuery

func (r NewsGetRecapsParams) URLQuery() (v url.Values, err error)

URLQuery serializes NewsGetRecapsParams's query parameters as `url.Values`.

type NewsGetRecapsResponse

type NewsGetRecapsResponse struct {
	Data map[string]any            `json:"data,required"`
	Meta NewsGetRecapsResponseMeta `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsGetRecapsResponse) RawJSON

func (r NewsGetRecapsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsGetRecapsResponse) UnmarshalJSON

func (r *NewsGetRecapsResponse) UnmarshalJSON(data []byte) error

type NewsGetRecapsResponseMeta

type NewsGetRecapsResponseMeta struct {
	// Time period for recap data
	//
	// Any of "12h", "24h", "3d", "7d".
	Timeframe TimeframeEnum `json:"timeframe"`
	Topics    []TopicEnum   `json:"topics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Timeframe   respjson.Field
		Topics      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsGetRecapsResponseMeta) RawJSON

func (r NewsGetRecapsResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsGetRecapsResponseMeta) UnmarshalJSON

func (r *NewsGetRecapsResponseMeta) UnmarshalJSON(data []byte) error

type NewsListFeedsResponse

type NewsListFeedsResponse struct {
	Data []NewsListFeedsResponseData `json:"data,required"`
	Meta NewsListFeedsResponseMeta   `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListFeedsResponse) RawJSON

func (r NewsListFeedsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListFeedsResponse) UnmarshalJSON

func (r *NewsListFeedsResponse) UnmarshalJSON(data []byte) error

type NewsListFeedsResponseData

type NewsListFeedsResponseData struct {
	// Available news feed topics from GloriaAI
	//
	// Any of "ai", "ai_agents", "aptos", "base", "bitcoin", "crypto", "dats", "defi",
	// "ethereum", "hyperliquid", "machine_learning", "macro", "ondo", "perps",
	// "ripple", "rwa", "solana", "tech", "virtuals".
	ID TopicEnum `json:"id,required"`
	// Human-readable name
	Name string `json:"name,required"`
	// Feed description
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		Description respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListFeedsResponseData) RawJSON

func (r NewsListFeedsResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListFeedsResponseData) UnmarshalJSON

func (r *NewsListFeedsResponseData) UnmarshalJSON(data []byte) error

type NewsListFeedsResponseMeta

type NewsListFeedsResponseMeta struct {
	Count int64 `json:"count"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListFeedsResponseMeta) RawJSON

func (r NewsListFeedsResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListFeedsResponseMeta) UnmarshalJSON

func (r *NewsListFeedsResponseMeta) UnmarshalJSON(data []byte) error

type NewsListParams

type NewsListParams struct {
	// Maximum number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Comma-separated list of topics to filter by. Valid topics: ai, ai_agents, aptos,
	// base, bitcoin, crypto, dats, defi, ethereum, hyperliquid, machine_learning,
	// macro, ondo, perps, ripple, rwa, solana, tech, virtuals. Default: crypto,
	// ai_agents, macro, bitcoin, ethereum, tech
	Topics param.Opt[string] `query:"topics,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NewsListParams) URLQuery

func (r NewsListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NewsListParams's query parameters as `url.Values`.

type NewsListResponse

type NewsListResponse struct {
	Data []NewsListResponseData `json:"data,required"`
	Meta NewsListResponseMeta   `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListResponse) RawJSON

func (r NewsListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListResponse) UnmarshalJSON

func (r *NewsListResponse) UnmarshalJSON(data []byte) error

type NewsListResponseData

type NewsListResponseData struct {
	ID string `json:"id,required"`
	// Primary signal/headline
	Signal string `json:"signal,required"`
	// Unix timestamp (seconds)
	Timestamp    int64     `json:"timestamp,required"`
	TimestampISO time.Time `json:"timestampISO,required" format:"date-time"`
	Author       string    `json:"author"`
	Categories   []string  `json:"categories"`
	// Full context
	Content     string `json:"content"`
	NarrativeID string `json:"narrativeId"`
	// Sentiment classification for news items
	//
	// Any of "bullish", "bearish", "neutral".
	Sentiment      string   `json:"sentiment,nullable"`
	SentimentValue float64  `json:"sentimentValue"`
	Sources        []string `json:"sources"`
	// Short context summary
	Summary string `json:"summary"`
	// Related tokens/assets
	Tokens   []string `json:"tokens"`
	TweetURL string   `json:"tweetUrl" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Signal         respjson.Field
		Timestamp      respjson.Field
		TimestampISO   respjson.Field
		Author         respjson.Field
		Categories     respjson.Field
		Content        respjson.Field
		NarrativeID    respjson.Field
		Sentiment      respjson.Field
		SentimentValue respjson.Field
		Sources        respjson.Field
		Summary        respjson.Field
		Tokens         respjson.Field
		TweetURL       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListResponseData) RawJSON

func (r NewsListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListResponseData) UnmarshalJSON

func (r *NewsListResponseData) UnmarshalJSON(data []byte) error

type NewsListResponseMeta

type NewsListResponseMeta struct {
	Count  int64       `json:"count"`
	Limit  int64       `json:"limit"`
	Topics []TopicEnum `json:"topics"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Limit       respjson.Field
		Topics      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsListResponseMeta) RawJSON

func (r NewsListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsListResponseMeta) UnmarshalJSON

func (r *NewsListResponseMeta) UnmarshalJSON(data []byte) error

type NewsService

type NewsService struct {
	Options []option.RequestOption
}

NewsService contains methods and other services that help with interacting with the y2 API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNewsService method instead.

func NewNewsService

func NewNewsService(opts ...option.RequestOption) (r NewsService)

NewNewsService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NewsService) GetRecaps

func (r *NewsService) GetRecaps(ctx context.Context, query NewsGetRecapsParams, opts ...option.RequestOption) (res *NewsGetRecapsResponse, err error)

Returns AI-generated recap summaries for specified topics within a given timeframe.

func (*NewsService) List

func (r *NewsService) List(ctx context.Context, query NewsListParams, opts ...option.RequestOption) (res *NewsListResponse, err error)

Returns news items from the GloriaAI terminal cache. Supports filtering by topics and pagination.

func (*NewsService) ListFeeds

func (r *NewsService) ListFeeds(ctx context.Context, opts ...option.RequestOption) (res *NewsListFeedsResponse, err error)

Returns all available news feed topics with descriptions.

type ProfileDeleteResponse added in v0.4.0

type ProfileDeleteResponse struct {
	Data ProfileDeleteResponseData `json:"data,required"`
	Meta ProfileDeleteResponseMeta `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileDeleteResponse) RawJSON added in v0.4.0

func (r ProfileDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileDeleteResponse) UnmarshalJSON added in v0.4.0

func (r *ProfileDeleteResponse) UnmarshalJSON(data []byte) error

type ProfileDeleteResponseData added in v0.4.0

type ProfileDeleteResponseData struct {
	Deleted   bool   `json:"deleted,required"`
	ProfileID string `json:"profileId,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Deleted     respjson.Field
		ProfileID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileDeleteResponseData) RawJSON added in v0.4.0

func (r ProfileDeleteResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileDeleteResponseData) UnmarshalJSON added in v0.4.0

func (r *ProfileDeleteResponseData) UnmarshalJSON(data []byte) error

type ProfileDeleteResponseMeta added in v0.4.0

type ProfileDeleteResponseMeta struct {
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileDeleteResponseMeta) RawJSON added in v0.4.0

func (r ProfileDeleteResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileDeleteResponseMeta) UnmarshalJSON added in v0.4.0

func (r *ProfileDeleteResponseMeta) UnmarshalJSON(data []byte) error

type ProfileListResponse

type ProfileListResponse struct {
	Data []ProfileListResponseData `json:"data,required"`
	Meta ProfileListResponseMeta   `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileListResponse) RawJSON

func (r ProfileListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponse) UnmarshalJSON

func (r *ProfileListResponse) UnmarshalJSON(data []byte) error

type ProfileListResponseData

type ProfileListResponseData struct {
	// Any of "email", "sms", "webhook", "both_email_sms".
	DeliveryMethod string                         `json:"deliveryMethod,required"`
	IsActive       bool                           `json:"isActive,required"`
	ProfileID      string                         `json:"profileId,required"`
	SubscribedAt   int64                          `json:"subscribedAt,required"`
	SubscriptionID string                         `json:"subscriptionId,required"`
	Profile        ProfileListResponseDataProfile `json:"profile,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeliveryMethod respjson.Field
		IsActive       respjson.Field
		ProfileID      respjson.Field
		SubscribedAt   respjson.Field
		SubscriptionID respjson.Field
		Profile        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileListResponseData) RawJSON

func (r ProfileListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponseData) UnmarshalJSON

func (r *ProfileListResponseData) UnmarshalJSON(data []byte) error

type ProfileListResponseDataProfile

type ProfileListResponseDataProfile struct {
	AudioEnabled bool   `json:"audioEnabled"`
	Frequency    string `json:"frequency"`
	Name         string `json:"name"`
	Status       string `json:"status"`
	Topic        string `json:"topic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioEnabled respjson.Field
		Frequency    respjson.Field
		Name         respjson.Field
		Status       respjson.Field
		Topic        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileListResponseDataProfile) RawJSON

Returns the unmodified JSON received from the API

func (*ProfileListResponseDataProfile) UnmarshalJSON

func (r *ProfileListResponseDataProfile) UnmarshalJSON(data []byte) error

type ProfileListResponseMeta

type ProfileListResponseMeta struct {
	Count int64 `json:"count"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileListResponseMeta) RawJSON

func (r ProfileListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileListResponseMeta) UnmarshalJSON

func (r *ProfileListResponseMeta) UnmarshalJSON(data []byte) error

type ProfileNewParams added in v0.4.0

type ProfileNewParams struct {
	// Report generation frequency
	//
	// Any of "daily", "weekly", "biweekly", "monthly".
	Frequency ProfileNewParamsFrequency `json:"frequency,omitzero,required"`
	// Profile display name
	Name string `json:"name,required"`
	// Time of day for report generation (HH:mm, UTC)
	ScheduleTimeOfDay string `json:"scheduleTimeOfDay,required"`
	// Topic description for research
	Topic string `json:"topic,required"`
	// Custom BLUF report structure template
	BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
	// Custom system prompt for the AI analyst
	CustomPrompt param.Opt[string] `json:"customPrompt,omitzero"`
	// Whether this is a community (public) profile
	IsCommunity param.Opt[bool] `json:"isCommunity,omitzero"`
	// Day of month for monthly profiles
	ScheduleDayOfMonth param.Opt[string] `json:"scheduleDayOfMonth,omitzero"`
	// Day of week for weekly/biweekly profiles
	ScheduleDayOfWeek param.Opt[string]               `json:"scheduleDayOfWeek,omitzero"`
	RecursionConfig   ProfileNewParamsRecursionConfig `json:"recursionConfig,omitzero"`
	// Tags for categorization
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileNewParams) MarshalJSON added in v0.4.0

func (r ProfileNewParams) MarshalJSON() (data []byte, err error)

func (*ProfileNewParams) UnmarshalJSON added in v0.4.0

func (r *ProfileNewParams) UnmarshalJSON(data []byte) error

type ProfileNewParamsFrequency added in v0.4.0

type ProfileNewParamsFrequency string

Report generation frequency

const (
	ProfileNewParamsFrequencyDaily    ProfileNewParamsFrequency = "daily"
	ProfileNewParamsFrequencyWeekly   ProfileNewParamsFrequency = "weekly"
	ProfileNewParamsFrequencyBiweekly ProfileNewParamsFrequency = "biweekly"
	ProfileNewParamsFrequencyMonthly  ProfileNewParamsFrequency = "monthly"
)

type ProfileNewParamsRecursionConfig added in v0.4.0

type ProfileNewParamsRecursionConfig struct {
	Enabled  bool  `json:"enabled,required"`
	MaxDepth int64 `json:"maxDepth,required"`
	// Any of "breadth-first", "depth-first", "hybrid".
	Strategy string `json:"strategy,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Enabled, MaxDepth, Strategy are required.

func (ProfileNewParamsRecursionConfig) MarshalJSON added in v0.4.0

func (r ProfileNewParamsRecursionConfig) MarshalJSON() (data []byte, err error)

func (*ProfileNewParamsRecursionConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileNewParamsRecursionConfig) UnmarshalJSON(data []byte) error

type ProfileNewResponse added in v0.4.0

type ProfileNewResponse struct {
	Data ProfileNewResponseData `json:"data,required"`
	Meta ProfileNewResponseMeta `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileNewResponse) RawJSON added in v0.4.0

func (r ProfileNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponse) UnmarshalJSON added in v0.4.0

func (r *ProfileNewResponse) UnmarshalJSON(data []byte) error

type ProfileNewResponseData added in v0.4.0

type ProfileNewResponseData struct {
	// The ID of the newly created profile
	ProfileID string `json:"profileId,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProfileID   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileNewResponseData) RawJSON added in v0.4.0

func (r ProfileNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseData) UnmarshalJSON added in v0.4.0

func (r *ProfileNewResponseData) UnmarshalJSON(data []byte) error

type ProfileNewResponseMeta added in v0.4.0

type ProfileNewResponseMeta struct {
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileNewResponseMeta) RawJSON added in v0.4.0

func (r ProfileNewResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileNewResponseMeta) UnmarshalJSON added in v0.4.0

func (r *ProfileNewResponseMeta) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParams added in v0.4.0

type ProfilePartialUpdateParams struct {
	BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
	// Branding template ID (Pro feature)
	BrandingTemplateID param.Opt[string]                      `json:"brandingTemplateId,omitzero"`
	CustomPrompt       param.Opt[string]                      `json:"customPrompt,omitzero"`
	IsCommunity        param.Opt[bool]                        `json:"isCommunity,omitzero"`
	Name               param.Opt[string]                      `json:"name,omitzero"`
	ScheduleDayOfMonth param.Opt[string]                      `json:"scheduleDayOfMonth,omitzero"`
	ScheduleDayOfWeek  param.Opt[string]                      `json:"scheduleDayOfWeek,omitzero"`
	ScheduleTimeOfDay  param.Opt[string]                      `json:"scheduleTimeOfDay,omitzero"`
	Topic              param.Opt[string]                      `json:"topic,omitzero"`
	AudioConfig        ProfilePartialUpdateParamsAudioConfig  `json:"audioConfig,omitzero"`
	BudgetConfig       ProfilePartialUpdateParamsBudgetConfig `json:"budgetConfig,omitzero"`
	// Report generation frequency
	//
	// Any of "daily", "weekly", "biweekly", "monthly".
	Frequency       ProfilePartialUpdateParamsFrequency       `json:"frequency,omitzero"`
	FreshnessConfig ProfilePartialUpdateParamsFreshnessConfig `json:"freshnessConfig,omitzero"`
	ModelConfig     ProfilePartialUpdateParamsModelConfig     `json:"modelConfig,omitzero"`
	RecursionConfig ProfilePartialUpdateParamsRecursionConfig `json:"recursionConfig,omitzero"`
	SearchConfig    ProfilePartialUpdateParamsSearchConfig    `json:"searchConfig,omitzero"`
	// Profile status
	//
	// Any of "active", "paused", "cancelled".
	Status ProfilePartialUpdateParamsStatus `json:"status,omitzero"`
	Tags   []string                         `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParams) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParams) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParams) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParams) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsAudioConfig added in v0.4.0

type ProfilePartialUpdateParamsAudioConfig struct {
	Enabled param.Opt[bool]    `json:"enabled,omitzero"`
	Speed   param.Opt[float64] `json:"speed,omitzero"`
	VoiceID param.Opt[string]  `json:"voiceId,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParamsAudioConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsAudioConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsAudioConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsAudioConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsBudgetConfig added in v0.4.0

type ProfilePartialUpdateParamsBudgetConfig struct {
	AlertThreshold   param.Opt[float64] `json:"alertThreshold,omitzero"`
	MaxCostPerReport param.Opt[float64] `json:"maxCostPerReport,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParamsBudgetConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsBudgetConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsBudgetConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsBudgetConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsFrequency added in v0.4.0

type ProfilePartialUpdateParamsFrequency string

Report generation frequency

const (
	ProfilePartialUpdateParamsFrequencyDaily    ProfilePartialUpdateParamsFrequency = "daily"
	ProfilePartialUpdateParamsFrequencyWeekly   ProfilePartialUpdateParamsFrequency = "weekly"
	ProfilePartialUpdateParamsFrequencyBiweekly ProfilePartialUpdateParamsFrequency = "biweekly"
	ProfilePartialUpdateParamsFrequencyMonthly  ProfilePartialUpdateParamsFrequency = "monthly"
)

type ProfilePartialUpdateParamsFreshnessConfig added in v0.4.0

type ProfilePartialUpdateParamsFreshnessConfig struct {
	Enabled             param.Opt[bool]    `json:"enabled,omitzero"`
	MaxAgeMs            param.Opt[int64]   `json:"maxAgeMs,omitzero"`
	PreferRecentSources param.Opt[bool]    `json:"preferRecentSources,omitzero"`
	RecencyWeight       param.Opt[float64] `json:"recencyWeight,omitzero"`
	ValidateLinks       param.Opt[bool]    `json:"validateLinks,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParamsFreshnessConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsFreshnessConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsFreshnessConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsFreshnessConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsModelConfig added in v0.4.0

type ProfilePartialUpdateParamsModelConfig struct {
	MaxOutputTokens param.Opt[int64]   `json:"maxOutputTokens,omitzero"`
	ModelID         param.Opt[string]  `json:"modelId,omitzero"`
	Temperature     param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParamsModelConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsModelConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsModelConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsModelConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsRecursionConfig added in v0.4.0

type ProfilePartialUpdateParamsRecursionConfig struct {
	Enabled  bool  `json:"enabled,required"`
	MaxDepth int64 `json:"maxDepth,required"`
	// Any of "breadth-first", "depth-first", "hybrid".
	Strategy string `json:"strategy,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Enabled, MaxDepth, Strategy are required.

func (ProfilePartialUpdateParamsRecursionConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsRecursionConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsRecursionConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsRecursionConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsSearchConfig added in v0.4.0

type ProfilePartialUpdateParamsSearchConfig struct {
	MaxResults     param.Opt[int64]  `json:"maxResults,omitzero"`
	TimeRange      param.Opt[string] `json:"timeRange,omitzero"`
	Topic          param.Opt[string] `json:"topic,omitzero"`
	ExcludeDomains []string          `json:"excludeDomains,omitzero"`
	IncludeDomains []string          `json:"includeDomains,omitzero"`
	// Any of "basic", "advanced".
	SearchDepth string `json:"searchDepth,omitzero"`
	// contains filtered or unexported fields
}

func (ProfilePartialUpdateParamsSearchConfig) MarshalJSON added in v0.4.0

func (r ProfilePartialUpdateParamsSearchConfig) MarshalJSON() (data []byte, err error)

func (*ProfilePartialUpdateParamsSearchConfig) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateParamsSearchConfig) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateParamsStatus added in v0.4.0

type ProfilePartialUpdateParamsStatus string

Profile status

const (
	ProfilePartialUpdateParamsStatusActive    ProfilePartialUpdateParamsStatus = "active"
	ProfilePartialUpdateParamsStatusPaused    ProfilePartialUpdateParamsStatus = "paused"
	ProfilePartialUpdateParamsStatusCancelled ProfilePartialUpdateParamsStatus = "cancelled"
)

type ProfilePartialUpdateResponse added in v0.4.0

type ProfilePartialUpdateResponse struct {
	Data ProfilePartialUpdateResponseData `json:"data,required"`
	Meta ProfilePartialUpdateResponseMeta `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfilePartialUpdateResponse) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*ProfilePartialUpdateResponse) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateResponse) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateResponseData added in v0.4.0

type ProfilePartialUpdateResponseData struct {
	ProfileID string `json:"profileId,required"`
	Success   bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProfileID   respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfilePartialUpdateResponseData) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*ProfilePartialUpdateResponseData) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateResponseData) UnmarshalJSON(data []byte) error

type ProfilePartialUpdateResponseMeta added in v0.4.0

type ProfilePartialUpdateResponseMeta struct {
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfilePartialUpdateResponseMeta) RawJSON added in v0.4.0

Returns the unmodified JSON received from the API

func (*ProfilePartialUpdateResponseMeta) UnmarshalJSON added in v0.4.0

func (r *ProfilePartialUpdateResponseMeta) UnmarshalJSON(data []byte) error

type ProfileService

type ProfileService struct {
	Options []option.RequestOption
}

ProfileService contains methods and other services that help with interacting with the y2 API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProfileService method instead.

func NewProfileService

func NewProfileService(opts ...option.RequestOption) (r ProfileService)

NewProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProfileService) Delete added in v0.4.0

func (r *ProfileService) Delete(ctx context.Context, profileID string, opts ...option.RequestOption) (res *ProfileDeleteResponse, err error)

Permanently deletes an intelligence profile and all associated subscriptions. Only profiles owned by the authenticated user can be deleted. This action cannot be undone.

func (*ProfileService) List

func (r *ProfileService) List(ctx context.Context, opts ...option.RequestOption) (res *ProfileListResponse, err error)

Returns a list of intelligence profiles the user is subscribed to, including subscription status and delivery preferences.

func (*ProfileService) New added in v0.4.0

Creates a new intelligence profile with the specified configuration. The profile will be owned by the authenticated user and start with `active` status.

func (*ProfileService) PartialUpdate added in v0.4.0

func (r *ProfileService) PartialUpdate(ctx context.Context, profileID string, body ProfilePartialUpdateParams, opts ...option.RequestOption) (res *ProfilePartialUpdateResponse, err error)

Partially updates an existing intelligence profile. Only the fields included in the request body will be modified; all other fields remain unchanged. Only profiles owned by the authenticated user can be updated.

func (*ProfileService) Update added in v0.4.0

func (r *ProfileService) Update(ctx context.Context, profileID string, body ProfileUpdateParams, opts ...option.RequestOption) (res *ProfileUpdateResponse, err error)

Replaces all mutable fields of an existing intelligence profile. Only profiles owned by the authenticated user can be updated.

type ProfileUpdateParams added in v0.4.0

type ProfileUpdateParams struct {
	BlufStructure param.Opt[string] `json:"blufStructure,omitzero"`
	// Branding template ID (Pro feature)
	BrandingTemplateID param.Opt[string]               `json:"brandingTemplateId,omitzero"`
	CustomPrompt       param.Opt[string]               `json:"customPrompt,omitzero"`
	IsCommunity        param.Opt[bool]                 `json:"isCommunity,omitzero"`
	Name               param.Opt[string]               `json:"name,omitzero"`
	ScheduleDayOfMonth param.Opt[string]               `json:"scheduleDayOfMonth,omitzero"`
	ScheduleDayOfWeek  param.Opt[string]               `json:"scheduleDayOfWeek,omitzero"`
	ScheduleTimeOfDay  param.Opt[string]               `json:"scheduleTimeOfDay,omitzero"`
	Topic              param.Opt[string]               `json:"topic,omitzero"`
	AudioConfig        ProfileUpdateParamsAudioConfig  `json:"audioConfig,omitzero"`
	BudgetConfig       ProfileUpdateParamsBudgetConfig `json:"budgetConfig,omitzero"`
	// Report generation frequency
	//
	// Any of "daily", "weekly", "biweekly", "monthly".
	Frequency       ProfileUpdateParamsFrequency       `json:"frequency,omitzero"`
	FreshnessConfig ProfileUpdateParamsFreshnessConfig `json:"freshnessConfig,omitzero"`
	ModelConfig     ProfileUpdateParamsModelConfig     `json:"modelConfig,omitzero"`
	RecursionConfig ProfileUpdateParamsRecursionConfig `json:"recursionConfig,omitzero"`
	SearchConfig    ProfileUpdateParamsSearchConfig    `json:"searchConfig,omitzero"`
	// Profile status
	//
	// Any of "active", "paused", "cancelled".
	Status ProfileUpdateParamsStatus `json:"status,omitzero"`
	Tags   []string                  `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParams) MarshalJSON added in v0.4.0

func (r ProfileUpdateParams) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParams) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParams) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsAudioConfig added in v0.4.0

type ProfileUpdateParamsAudioConfig struct {
	Enabled param.Opt[bool]    `json:"enabled,omitzero"`
	Speed   param.Opt[float64] `json:"speed,omitzero"`
	VoiceID param.Opt[string]  `json:"voiceId,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParamsAudioConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsAudioConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsAudioConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsAudioConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsBudgetConfig added in v0.4.0

type ProfileUpdateParamsBudgetConfig struct {
	AlertThreshold   param.Opt[float64] `json:"alertThreshold,omitzero"`
	MaxCostPerReport param.Opt[float64] `json:"maxCostPerReport,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParamsBudgetConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsBudgetConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsBudgetConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsBudgetConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsFrequency added in v0.4.0

type ProfileUpdateParamsFrequency string

Report generation frequency

const (
	ProfileUpdateParamsFrequencyDaily    ProfileUpdateParamsFrequency = "daily"
	ProfileUpdateParamsFrequencyWeekly   ProfileUpdateParamsFrequency = "weekly"
	ProfileUpdateParamsFrequencyBiweekly ProfileUpdateParamsFrequency = "biweekly"
	ProfileUpdateParamsFrequencyMonthly  ProfileUpdateParamsFrequency = "monthly"
)

type ProfileUpdateParamsFreshnessConfig added in v0.4.0

type ProfileUpdateParamsFreshnessConfig struct {
	Enabled             param.Opt[bool]    `json:"enabled,omitzero"`
	MaxAgeMs            param.Opt[int64]   `json:"maxAgeMs,omitzero"`
	PreferRecentSources param.Opt[bool]    `json:"preferRecentSources,omitzero"`
	RecencyWeight       param.Opt[float64] `json:"recencyWeight,omitzero"`
	ValidateLinks       param.Opt[bool]    `json:"validateLinks,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParamsFreshnessConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsFreshnessConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsFreshnessConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsFreshnessConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsModelConfig added in v0.4.0

type ProfileUpdateParamsModelConfig struct {
	MaxOutputTokens param.Opt[int64]   `json:"maxOutputTokens,omitzero"`
	ModelID         param.Opt[string]  `json:"modelId,omitzero"`
	Temperature     param.Opt[float64] `json:"temperature,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParamsModelConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsModelConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsModelConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsModelConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsRecursionConfig added in v0.4.0

type ProfileUpdateParamsRecursionConfig struct {
	Enabled  bool  `json:"enabled,required"`
	MaxDepth int64 `json:"maxDepth,required"`
	// Any of "breadth-first", "depth-first", "hybrid".
	Strategy string `json:"strategy,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Enabled, MaxDepth, Strategy are required.

func (ProfileUpdateParamsRecursionConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsRecursionConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsRecursionConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsRecursionConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsSearchConfig added in v0.4.0

type ProfileUpdateParamsSearchConfig struct {
	MaxResults     param.Opt[int64]  `json:"maxResults,omitzero"`
	TimeRange      param.Opt[string] `json:"timeRange,omitzero"`
	Topic          param.Opt[string] `json:"topic,omitzero"`
	ExcludeDomains []string          `json:"excludeDomains,omitzero"`
	IncludeDomains []string          `json:"includeDomains,omitzero"`
	// Any of "basic", "advanced".
	SearchDepth string `json:"searchDepth,omitzero"`
	// contains filtered or unexported fields
}

func (ProfileUpdateParamsSearchConfig) MarshalJSON added in v0.4.0

func (r ProfileUpdateParamsSearchConfig) MarshalJSON() (data []byte, err error)

func (*ProfileUpdateParamsSearchConfig) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateParamsSearchConfig) UnmarshalJSON(data []byte) error

type ProfileUpdateParamsStatus added in v0.4.0

type ProfileUpdateParamsStatus string

Profile status

const (
	ProfileUpdateParamsStatusActive    ProfileUpdateParamsStatus = "active"
	ProfileUpdateParamsStatusPaused    ProfileUpdateParamsStatus = "paused"
	ProfileUpdateParamsStatusCancelled ProfileUpdateParamsStatus = "cancelled"
)

type ProfileUpdateResponse added in v0.4.0

type ProfileUpdateResponse struct {
	Data ProfileUpdateResponseData `json:"data,required"`
	Meta ProfileUpdateResponseMeta `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileUpdateResponse) RawJSON added in v0.4.0

func (r ProfileUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponse) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateResponse) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseData added in v0.4.0

type ProfileUpdateResponseData struct {
	ProfileID string `json:"profileId,required"`
	Success   bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ProfileID   respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileUpdateResponseData) RawJSON added in v0.4.0

func (r ProfileUpdateResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseData) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateResponseData) UnmarshalJSON(data []byte) error

type ProfileUpdateResponseMeta added in v0.4.0

type ProfileUpdateResponseMeta struct {
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileUpdateResponseMeta) RawJSON added in v0.4.0

func (r ProfileUpdateResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileUpdateResponseMeta) UnmarshalJSON added in v0.4.0

func (r *ProfileUpdateResponseMeta) UnmarshalJSON(data []byte) error

type ReportGetAudioParams

type ReportGetAudioParams struct {
	// If true, returns 302 redirect to audio CDN URL
	Redirect param.Opt[bool] `query:"redirect,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ReportGetAudioParams) URLQuery

func (r ReportGetAudioParams) URLQuery() (v url.Values, err error)

URLQuery serializes ReportGetAudioParams's query parameters as `url.Values`.

type ReportGetAudioResponse

type ReportGetAudioResponse struct {
	Data AudioMetadata `json:"data,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportGetAudioResponse) RawJSON

func (r ReportGetAudioResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportGetAudioResponse) UnmarshalJSON

func (r *ReportGetAudioResponse) UnmarshalJSON(data []byte) error

type ReportGetResponse

type ReportGetResponse struct {
	Data ReportGetResponseData `json:"data,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportGetResponse) RawJSON

func (r ReportGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportGetResponse) UnmarshalJSON

func (r *ReportGetResponse) UnmarshalJSON(data []byte) error

type ReportGetResponseData

type ReportGetResponseData struct {
	ID             string                        `json:"id,required"`
	Content        ReportGetResponseDataContent  `json:"content,required"`
	GeneratedAt    int64                         `json:"generatedAt,required"`
	GeneratedAtISO time.Time                     `json:"generatedAtISO,required" format:"date-time"`
	ProfileID      string                        `json:"profileId,required"`
	Audio          AudioMetadata                 `json:"audio,nullable"`
	Metadata       ReportGetResponseDataMetadata `json:"metadata"`
	ProfileName    string                        `json:"profileName"`
	ProfileTopic   string                        `json:"profileTopic"`
	Sources        []string                      `json:"sources" format:"uri"`
	Topic          string                        `json:"topic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Content        respjson.Field
		GeneratedAt    respjson.Field
		GeneratedAtISO respjson.Field
		ProfileID      respjson.Field
		Audio          respjson.Field
		Metadata       respjson.Field
		ProfileName    respjson.Field
		ProfileTopic   respjson.Field
		Sources        respjson.Field
		Topic          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportGetResponseData) RawJSON

func (r ReportGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportGetResponseData) UnmarshalJSON

func (r *ReportGetResponseData) UnmarshalJSON(data []byte) error

type ReportGetResponseDataContent

type ReportGetResponseDataContent struct {
	// Full HTML content
	HTML string `json:"html"`
	// SMS-friendly summary
	Summary string `json:"summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		HTML        respjson.Field
		Summary     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportGetResponseDataContent) RawJSON

Returns the unmodified JSON received from the API

func (*ReportGetResponseDataContent) UnmarshalJSON

func (r *ReportGetResponseDataContent) UnmarshalJSON(data []byte) error

type ReportGetResponseDataMetadata

type ReportGetResponseDataMetadata struct {
	// Source freshness validation results
	FreshnessMetadata ReportGetResponseDataMetadataFreshnessMetadata `json:"freshnessMetadata"`
	Model             string                                         `json:"model"`
	// Metadata about recursive research execution
	RecursionMetadata ReportGetResponseDataMetadataRecursionMetadata `json:"recursionMetadata"`
	TotalCost         float64                                        `json:"totalCost"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FreshnessMetadata respjson.Field
		Model             respjson.Field
		RecursionMetadata respjson.Field
		TotalCost         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportGetResponseDataMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*ReportGetResponseDataMetadata) UnmarshalJSON

func (r *ReportGetResponseDataMetadata) UnmarshalJSON(data []byte) error

type ReportGetResponseDataMetadataFreshnessMetadata

type ReportGetResponseDataMetadataFreshnessMetadata struct {
	AccessibleLinks int64 `json:"accessibleLinks"`
	// Average source age in milliseconds
	AverageAgeMs int64 `json:"averageAgeMs"`
	// Overall freshness score (higher = fresher)
	FreshnessScore    float64 `json:"freshnessScore"`
	StaleSourcesCount int64   `json:"staleSourcesCount"`
	TotalLinks        int64   `json:"totalLinks"`
	ValidatedAt       int64   `json:"validatedAt"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessibleLinks   respjson.Field
		AverageAgeMs      respjson.Field
		FreshnessScore    respjson.Field
		StaleSourcesCount respjson.Field
		TotalLinks        respjson.Field
		ValidatedAt       respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Source freshness validation results

func (ReportGetResponseDataMetadataFreshnessMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*ReportGetResponseDataMetadataFreshnessMetadata) UnmarshalJSON

type ReportGetResponseDataMetadataRecursionMetadata

type ReportGetResponseDataMetadataRecursionMetadata struct {
	// Recursion depth achieved (0 = standard report)
	Depth int64 `json:"depth"`
	// Reason if fallback to standard generation occurred
	FallbackReason  string `json:"fallbackReason"`
	LayersProcessed int64  `json:"layersProcessed"`
	// Any of "breadth-first", "depth-first", "hybrid".
	Strategy                string   `json:"strategy"`
	SubtopicsGenerated      []string `json:"subtopicsGenerated"`
	TotalSourcesCollected   int64    `json:"totalSourcesCollected"`
	TotalTimeMs             int64    `json:"totalTimeMs"`
	UniqueSourcesAggregated int64    `json:"uniqueSourcesAggregated"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Depth                   respjson.Field
		FallbackReason          respjson.Field
		LayersProcessed         respjson.Field
		Strategy                respjson.Field
		SubtopicsGenerated      respjson.Field
		TotalSourcesCollected   respjson.Field
		TotalTimeMs             respjson.Field
		UniqueSourcesAggregated respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata about recursive research execution

func (ReportGetResponseDataMetadataRecursionMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*ReportGetResponseDataMetadataRecursionMetadata) UnmarshalJSON

type ReportListParams

type ReportListParams struct {
	// Maximum number of reports to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter reports by profile ID
	ProfileID param.Opt[string] `query:"profileId,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ReportListParams) URLQuery

func (r ReportListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ReportListParams's query parameters as `url.Values`.

type ReportListResponse

type ReportListResponse struct {
	Data []ReportListResponseData `json:"data,required"`
	Meta ReportListResponseMeta   `json:"meta,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportListResponse) RawJSON

func (r ReportListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportListResponse) UnmarshalJSON

func (r *ReportListResponse) UnmarshalJSON(data []byte) error

type ReportListResponseData

type ReportListResponseData struct {
	// Report ID (Convex document ID)
	ID string `json:"id,required"`
	// Unix timestamp (milliseconds)
	GeneratedAt int64 `json:"generatedAt,required"`
	// ISO 8601 timestamp
	GeneratedAtISO time.Time `json:"generatedAtISO,required" format:"date-time"`
	// Profile ID this report belongs to
	ProfileID string `json:"profileId,required"`
	// Whether audio narration is available
	HasAudio bool `json:"hasAudio"`
	// LLM model used for generation
	Model string `json:"model"`
	// Brief SMS-friendly summary
	Summary string `json:"summary"`
	// Report topic
	Topic string `json:"topic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		GeneratedAt    respjson.Field
		GeneratedAtISO respjson.Field
		ProfileID      respjson.Field
		HasAudio       respjson.Field
		Model          respjson.Field
		Summary        respjson.Field
		Topic          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportListResponseData) RawJSON

func (r ReportListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportListResponseData) UnmarshalJSON

func (r *ReportListResponseData) UnmarshalJSON(data []byte) error

type ReportListResponseMeta

type ReportListResponseMeta struct {
	Count int64 `json:"count"`
	Limit int64 `json:"limit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Limit       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ReportListResponseMeta) RawJSON

func (r ReportListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*ReportListResponseMeta) UnmarshalJSON

func (r *ReportListResponseMeta) UnmarshalJSON(data []byte) error

type ReportService

type ReportService struct {
	Options []option.RequestOption
}

ReportService contains methods and other services that help with interacting with the y2 API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewReportService method instead.

func NewReportService

func NewReportService(opts ...option.RequestOption) (r ReportService)

NewReportService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ReportService) Get

func (r *ReportService) Get(ctx context.Context, reportID string, opts ...option.RequestOption) (res *ReportGetResponse, err error)

Returns the full content of a specific intelligence report, including HTML content, sources, and audio metadata.

func (*ReportService) GetAudio

func (r *ReportService) GetAudio(ctx context.Context, reportID string, query ReportGetAudioParams, opts ...option.RequestOption) (res *ReportGetAudioResponse, err error)

Returns audio file metadata or redirects to the CDN URL. Requires the `reports:audio` scope.

func (*ReportService) List

func (r *ReportService) List(ctx context.Context, query ReportListParams, opts ...option.RequestOption) (res *ReportListResponse, err error)

Returns a list of reports for the user's subscribed profiles. Results are sorted by generation date (newest first).

type TimeframeEnum

type TimeframeEnum string

Time period for recap data

const (
	TimeframeEnum12h TimeframeEnum = "12h"
	TimeframeEnum24h TimeframeEnum = "24h"
	TimeframeEnum3d  TimeframeEnum = "3d"
	TimeframeEnum7d  TimeframeEnum = "7d"
)

type TopicEnum

type TopicEnum string

Available news feed topics from GloriaAI

const (
	TopicEnumAI              TopicEnum = "ai"
	TopicEnumAIAgents        TopicEnum = "ai_agents"
	TopicEnumAptos           TopicEnum = "aptos"
	TopicEnumBase            TopicEnum = "base"
	TopicEnumBitcoin         TopicEnum = "bitcoin"
	TopicEnumCrypto          TopicEnum = "crypto"
	TopicEnumDats            TopicEnum = "dats"
	TopicEnumDefi            TopicEnum = "defi"
	TopicEnumEthereum        TopicEnum = "ethereum"
	TopicEnumHyperliquid     TopicEnum = "hyperliquid"
	TopicEnumMachineLearning TopicEnum = "machine_learning"
	TopicEnumMacro           TopicEnum = "macro"
	TopicEnumOndo            TopicEnum = "ondo"
	TopicEnumPerps           TopicEnum = "perps"
	TopicEnumRipple          TopicEnum = "ripple"
	TopicEnumRwa             TopicEnum = "rwa"
	TopicEnumSolana          TopicEnum = "solana"
	TopicEnumTech            TopicEnum = "tech"
	TopicEnumVirtuals        TopicEnum = "virtuals"
)

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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