gqclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: CC-BY-4.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CreateForecast_Operation = `` /* 148-byte string literal not displayed */

The query or mutation executed by CreateForecast.

View Source
const GetForecasts_Operation = `
query GetForecasts {
	forecasts {
		id
		title
		description
		created
		closes
		resolves
		resolution
	}
}
`

The query or mutation executed by GetForecasts.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateForecastCreateForecast

type CreateForecastCreateForecast struct {
	Id string `json:"id"`
}

CreateForecastCreateForecast includes the requested fields of the GraphQL type Forecast. The GraphQL type's documentation follows.

A prediction about the future.

func (*CreateForecastCreateForecast) GetId

GetId returns CreateForecastCreateForecast.Id, and is useful for accessing the field via an interface.

type CreateForecastResponse

type CreateForecastResponse struct {
	CreateForecast CreateForecastCreateForecast `json:"createForecast"`
}

CreateForecastResponse is returned by CreateForecast on success.

func CreateForecast

func CreateForecast(
	ctx context.Context,
	client graphql.Client,
	forecast NewForecast,
	estimate NewEstimate,
) (*CreateForecastResponse, error)

func (*CreateForecastResponse) GetCreateForecast

GetCreateForecast returns CreateForecastResponse.CreateForecast, and is useful for accessing the field via an interface.

type GetForecastsForecastsForecast

type GetForecastsForecastsForecast struct {
	Id          string    `json:"id"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Created     time.Time `json:"created"`
	// The point in time at which you no longer want to update your probability
	// estimates for the forecast. In most cases you won't need this. One example
	// where you might is when you want to predict the outcome of an exam. You may
	// want to set 'closes' to the time right before the exam starts, even though
	// 'resolves' is several weeks later (when the exam results are published). This
	// way your prediction history will only reflect your estimations before you
	// took the exam, which is something you may want (or not, in which case you
	// could simply not set 'closes').
	Closes *time.Time `json:"closes"`
	// The point in time at which you predict you will be able to resolve whether
	// how the forecast resolved.
	Resolves   time.Time  `json:"resolves"`
	Resolution Resolution `json:"resolution"`
}

GetForecastsForecastsForecast includes the requested fields of the GraphQL type Forecast. The GraphQL type's documentation follows.

A prediction about the future.

func (*GetForecastsForecastsForecast) GetCloses

func (v *GetForecastsForecastsForecast) GetCloses() *time.Time

GetCloses returns GetForecastsForecastsForecast.Closes, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetCreated

func (v *GetForecastsForecastsForecast) GetCreated() time.Time

GetCreated returns GetForecastsForecastsForecast.Created, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetDescription

func (v *GetForecastsForecastsForecast) GetDescription() string

GetDescription returns GetForecastsForecastsForecast.Description, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetId

GetId returns GetForecastsForecastsForecast.Id, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetResolution

func (v *GetForecastsForecastsForecast) GetResolution() Resolution

GetResolution returns GetForecastsForecastsForecast.Resolution, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetResolves

func (v *GetForecastsForecastsForecast) GetResolves() time.Time

GetResolves returns GetForecastsForecastsForecast.Resolves, and is useful for accessing the field via an interface.

func (*GetForecastsForecastsForecast) GetTitle

func (v *GetForecastsForecastsForecast) GetTitle() string

GetTitle returns GetForecastsForecastsForecast.Title, and is useful for accessing the field via an interface.

type GetForecastsResponse

type GetForecastsResponse struct {
	Forecasts []GetForecastsForecastsForecast `json:"forecasts"`
}

GetForecastsResponse is returned by GetForecasts on success.

func GetForecasts

func GetForecasts(
	ctx context.Context,
	client graphql.Client,
) (*GetForecastsResponse, error)

func (*GetForecastsResponse) GetForecasts

GetForecasts returns GetForecastsResponse.Forecasts, and is useful for accessing the field via an interface.

type NewEstimate

type NewEstimate struct {
	Reason        string           `json:"reason"`
	Probabilities []NewProbability `json:"probabilities"`
	// An optional date in the past when you created this estimate. This can be
	// useful for cases when you wrote it down on a piece of paper or when importing
	// from other software. When creating a new Forecast this value will be for
	// the first Estimate (which will get the same timestamp as the
	// Forecast.Created).
	Created *time.Time `json:"created"`
}

func (*NewEstimate) GetCreated added in v0.2.0

func (v *NewEstimate) GetCreated() *time.Time

GetCreated returns NewEstimate.Created, and is useful for accessing the field via an interface.

func (*NewEstimate) GetProbabilities

func (v *NewEstimate) GetProbabilities() []NewProbability

GetProbabilities returns NewEstimate.Probabilities, and is useful for accessing the field via an interface.

func (*NewEstimate) GetReason

func (v *NewEstimate) GetReason() string

GetReason returns NewEstimate.Reason, and is useful for accessing the field via an interface.

type NewForecast

type NewForecast struct {
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Resolves    time.Time  `json:"resolves"`
	Closes      *time.Time `json:"closes"`
	// An optional date in the past when you created this forecast. This can be
	// useful for cases when you wrote it down on a piece of paper or when importing
	// from other software.
	Created *time.Time `json:"created"`
}

func (*NewForecast) GetCloses

func (v *NewForecast) GetCloses() *time.Time

GetCloses returns NewForecast.Closes, and is useful for accessing the field via an interface.

func (*NewForecast) GetCreated added in v0.2.0

func (v *NewForecast) GetCreated() *time.Time

GetCreated returns NewForecast.Created, and is useful for accessing the field via an interface.

func (*NewForecast) GetDescription

func (v *NewForecast) GetDescription() string

GetDescription returns NewForecast.Description, and is useful for accessing the field via an interface.

func (*NewForecast) GetResolves

func (v *NewForecast) GetResolves() time.Time

GetResolves returns NewForecast.Resolves, and is useful for accessing the field via an interface.

func (*NewForecast) GetTitle

func (v *NewForecast) GetTitle() string

GetTitle returns NewForecast.Title, and is useful for accessing the field via an interface.

type NewOutcome

type NewOutcome struct {
	Text string `json:"text"`
}

func (*NewOutcome) GetText

func (v *NewOutcome) GetText() string

GetText returns NewOutcome.Text, and is useful for accessing the field via an interface.

type NewProbability

type NewProbability struct {
	Value   int        `json:"value"`
	Outcome NewOutcome `json:"outcome"`
}

func (*NewProbability) GetOutcome

func (v *NewProbability) GetOutcome() NewOutcome

GetOutcome returns NewProbability.Outcome, and is useful for accessing the field via an interface.

func (*NewProbability) GetValue

func (v *NewProbability) GetValue() int

GetValue returns NewProbability.Value, and is useful for accessing the field via an interface.

type Resolution

type Resolution string
const (
	ResolutionResolved      Resolution = "RESOLVED"
	ResolutionNotApplicable Resolution = "NOT_APPLICABLE"
	ResolutionUnresolved    Resolution = "UNRESOLVED"
)

Jump to

Keyboard shortcuts

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