postforme

package module
v0.1.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

Post For Me Go API Library

Go Reference

The Post For Me Go library provides convenient access to the Post For Me REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/DayMoonDevelopment/post-for-me-go" // imported as postforme
)

Or to pin the version:

go get -u 'github.com/DayMoonDevelopment/post-for-me-go@v0.1.0-alpha.5'

Requirements

This library requires Go 1.18+.

Usage

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

package main

import (
	"context"
	"fmt"

	"github.com/DayMoonDevelopment/post-for-me-go"
	"github.com/DayMoonDevelopment/post-for-me-go/option"
)

func main() {
	client := postforme.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("POST_FOR_ME_API_KEY")
	)
	socialPost, err := client.SocialPosts.New(context.TODO(), postforme.SocialPostNewParams{
		CreateSocialPost: postforme.CreateSocialPostParam{
			Caption:        "caption",
			SocialAccounts: []string{"string"},
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", socialPost.ID)
}

Request fields

The postforme 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, postforme.String(string), postforme.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 := postforme.ExampleParams{
	ID:   "id_xxx",                // required property
	Name: postforme.String("..."), // optional property

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

	Origin: postforme.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[postforme.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of it's 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 := postforme.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.SocialPosts.New(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 *postforme.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.SocialPosts.New(context.TODO(), postforme.SocialPostNewParams{
	CreateSocialPost: postforme.CreateSocialPostParam{
		Caption:        "caption",
		SocialAccounts: []string{"string"},
	},
})
if err != nil {
	var apierr *postforme.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 "/v1/social-posts": 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.SocialPosts.New(
	ctx,
	postforme.SocialPostNewParams{
		CreateSocialPost: postforme.CreateSocialPostParam{
			Caption:        "caption",
			SocialAccounts: []string{"string"},
		},
	},
	// 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 postforme.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 := postforme.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.SocialPosts.New(
	context.TODO(),
	postforme.SocialPostNewParams{
		CreateSocialPost: postforme.CreateSocialPostParam{
			Caption:        "caption",
			SocialAccounts: []string{"string"},
		},
	},
	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
socialPost, err := client.SocialPosts.New(
	context.TODO(),
	postforme.SocialPostNewParams{
		CreateSocialPost: postforme.CreateSocialPostParam{
			Caption:        "caption",
			SocialAccounts: []string{"string"},
		},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", socialPost)

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: postforme.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 := postforme.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 (POST_FOR_ME_API_KEY, POST_FOR_ME_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 BlueskyConfigurationDto

type BlueskyConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BlueskyConfigurationDto) RawJSON

func (r BlueskyConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (BlueskyConfigurationDto) ToParam

ToParam converts this BlueskyConfigurationDto to a BlueskyConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BlueskyConfigurationDtoParam.Overrides()

func (*BlueskyConfigurationDto) UnmarshalJSON

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

type BlueskyConfigurationDtoParam

type BlueskyConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (BlueskyConfigurationDtoParam) MarshalJSON

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

func (*BlueskyConfigurationDtoParam) UnmarshalJSON

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

type Client

type Client struct {
	Options           []option.RequestOption
	Media             MediaService
	SocialPosts       SocialPostService
	SocialPostResults SocialPostResultService
	SocialAccounts    SocialAccountService
}

Client creates a struct with services and top level methods that help with interacting with the post-for-me 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 (POST_FOR_ME_API_KEY, POST_FOR_ME_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 CreateSocialPostAccountConfigurationConfigurationParam

type CreateSocialPostAccountConfigurationConfigurationParam struct {
	// Allow comments on TikTok
	AllowComment param.Opt[bool] `json:"allow_comment,omitzero"`
	// Allow duets on TikTok
	AllowDuet param.Opt[bool] `json:"allow_duet,omitzero"`
	// Allow stitch on TikTok
	AllowStitch param.Opt[bool] `json:"allow_stitch,omitzero"`
	// Disclose branded content on TikTok
	DiscloseBrandedContent param.Opt[bool] `json:"disclose_branded_content,omitzero"`
	// Disclose your brand on TikTok
	DiscloseYourBrand param.Opt[bool] `json:"disclose_your_brand,omitzero"`
	// Flag content as AI generated on TikTok
	IsAIGenerated param.Opt[bool] `json:"is_ai_generated,omitzero"`
	// Will create a draft upload to TikTok, posting will need to be completed from
	// within the app
	IsDraft param.Opt[bool] `json:"is_draft,omitzero"`
	// Pinterest post link
	Link param.Opt[string] `json:"link,omitzero"`
	// Sets the privacy status for TikTok (private, public)
	PrivacyStatus param.Opt[string] `json:"privacy_status,omitzero"`
	// Overrides the `title` from the post
	Title param.Opt[string] `json:"title,omitzero"`
	// Pinterest board IDs
	BoardIDs []string `json:"board_ids,omitzero"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// Post placement for Facebook/Instagram/Threads
	//
	// Any of "reels", "timeline", "stories".
	Placement string `json:"placement,omitzero"`
	// contains filtered or unexported fields
}

Configuration for the social account

func (CreateSocialPostAccountConfigurationConfigurationParam) MarshalJSON

func (*CreateSocialPostAccountConfigurationConfigurationParam) UnmarshalJSON

type CreateSocialPostAccountConfigurationParam

type CreateSocialPostAccountConfigurationParam struct {
	// Configuration for the social account
	Configuration CreateSocialPostAccountConfigurationConfigurationParam `json:"configuration,omitzero,required"`
	// ID of the social account, you want to apply the configuration to
	SocialAccountID string `json:"social_account_id,required"`
	// contains filtered or unexported fields
}

The properties Configuration, SocialAccountID are required.

func (CreateSocialPostAccountConfigurationParam) MarshalJSON

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

func (*CreateSocialPostAccountConfigurationParam) UnmarshalJSON

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

type CreateSocialPostMediaParam

type CreateSocialPostMediaParam struct {
	// Public URL of the media
	URL string `json:"url,required"`
	// Timestamp in milliseconds of frame to use as thumbnail for the media
	ThumbnailTimestampMs any `json:"thumbnail_timestamp_ms,omitzero"`
	// Public URL of the thumbnail for the media
	ThumbnailURL any `json:"thumbnail_url,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (CreateSocialPostMediaParam) MarshalJSON

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

func (*CreateSocialPostMediaParam) UnmarshalJSON

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

type CreateSocialPostParam

type CreateSocialPostParam struct {
	// Caption text for the post
	Caption string `json:"caption,required"`
	// Array of social account IDs for posting
	SocialAccounts []string `json:"social_accounts,omitzero,required"`
	// Array of social account IDs for posting
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// If isDraft is set then the post will not be processed
	IsDraft param.Opt[bool] `json:"isDraft,omitzero"`
	// Scheduled date and time for the post, setting to null or undefined will post
	// instantly
	ScheduledAt param.Opt[time.Time] `json:"scheduled_at,omitzero" format:"date-time"`
	// Account-specific configurations for the post
	AccountConfigurations []CreateSocialPostAccountConfigurationParam `json:"account_configurations,omitzero"`
	// Array of media URLs associated with the post
	Media []CreateSocialPostMediaParam `json:"media,omitzero"`
	// Platform-specific configurations for the post
	PlatformConfigurations PlatformConfigurationsDtoParam `json:"platform_configurations,omitzero"`
	// contains filtered or unexported fields
}

The properties Caption, SocialAccounts are required.

func (CreateSocialPostParam) MarshalJSON

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

func (*CreateSocialPostParam) UnmarshalJSON

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

type Error

type Error = apierror.Error

type FacebookConfigurationDto

type FacebookConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Facebook post placement
	//
	// Any of "reels", "stories", "timeline".
	Placement FacebookConfigurationDtoPlacement `json:"placement,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		Placement   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FacebookConfigurationDto) RawJSON

func (r FacebookConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (FacebookConfigurationDto) ToParam

ToParam converts this FacebookConfigurationDto to a FacebookConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FacebookConfigurationDtoParam.Overrides()

func (*FacebookConfigurationDto) UnmarshalJSON

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

type FacebookConfigurationDtoParam

type FacebookConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// Facebook post placement
	//
	// Any of "reels", "stories", "timeline".
	Placement FacebookConfigurationDtoPlacement `json:"placement,omitzero"`
	// contains filtered or unexported fields
}

func (FacebookConfigurationDtoParam) MarshalJSON

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

func (*FacebookConfigurationDtoParam) UnmarshalJSON

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

type FacebookConfigurationDtoPlacement

type FacebookConfigurationDtoPlacement string

Facebook post placement

const (
	FacebookConfigurationDtoPlacementReels    FacebookConfigurationDtoPlacement = "reels"
	FacebookConfigurationDtoPlacementStories  FacebookConfigurationDtoPlacement = "stories"
	FacebookConfigurationDtoPlacementTimeline FacebookConfigurationDtoPlacement = "timeline"
)

type InstagramConfigurationDto

type InstagramConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Instagram usernames to be tagged as a collaborator
	Collaborators []string `json:"collaborators,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Instagram post placement
	//
	// Any of "reels", "stories", "timeline".
	Placement InstagramConfigurationDtoPlacement `json:"placement,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption       respjson.Field
		Collaborators respjson.Field
		Media         respjson.Field
		Placement     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InstagramConfigurationDto) RawJSON

func (r InstagramConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (InstagramConfigurationDto) ToParam

ToParam converts this InstagramConfigurationDto to a InstagramConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with InstagramConfigurationDtoParam.Overrides()

func (*InstagramConfigurationDto) UnmarshalJSON

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

type InstagramConfigurationDtoParam

type InstagramConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Instagram usernames to be tagged as a collaborator
	Collaborators []string `json:"collaborators,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// Instagram post placement
	//
	// Any of "reels", "stories", "timeline".
	Placement InstagramConfigurationDtoPlacement `json:"placement,omitzero"`
	// contains filtered or unexported fields
}

func (InstagramConfigurationDtoParam) MarshalJSON

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

func (*InstagramConfigurationDtoParam) UnmarshalJSON

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

type InstagramConfigurationDtoPlacement

type InstagramConfigurationDtoPlacement string

Instagram post placement

const (
	InstagramConfigurationDtoPlacementReels    InstagramConfigurationDtoPlacement = "reels"
	InstagramConfigurationDtoPlacementStories  InstagramConfigurationDtoPlacement = "stories"
	InstagramConfigurationDtoPlacementTimeline InstagramConfigurationDtoPlacement = "timeline"
)

type LinkedinConfigurationDto

type LinkedinConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LinkedinConfigurationDto) RawJSON

func (r LinkedinConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (LinkedinConfigurationDto) ToParam

ToParam converts this LinkedinConfigurationDto to a LinkedinConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with LinkedinConfigurationDtoParam.Overrides()

func (*LinkedinConfigurationDto) UnmarshalJSON

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

type LinkedinConfigurationDtoParam

type LinkedinConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (LinkedinConfigurationDtoParam) MarshalJSON

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

func (*LinkedinConfigurationDtoParam) UnmarshalJSON

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

type MediaNewUploadURLResponse

type MediaNewUploadURLResponse struct {
	// The public URL for the media, to use once file has been uploaded
	MediaURL string `json:"media_url,required"`
	// The signed upload URL for the client to upload the file
	UploadURL string `json:"upload_url,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MediaURL    respjson.Field
		UploadURL   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MediaNewUploadURLResponse) RawJSON

func (r MediaNewUploadURLResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MediaNewUploadURLResponse) UnmarshalJSON

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

type MediaService

type MediaService struct {
	Options []option.RequestOption
}

MediaService contains methods and other services that help with interacting with the post-for-me 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 NewMediaService method instead.

func NewMediaService

func NewMediaService(opts ...option.RequestOption) (r MediaService)

NewMediaService 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 (*MediaService) NewUploadURL

func (r *MediaService) NewUploadURL(ctx context.Context, opts ...option.RequestOption) (res *MediaNewUploadURLResponse, err error)

To upload media to attach to your post, make a `POST` request to the `/media/create-upload-url` endpoint.

You'll receive the public url of your media item (which can be used when making a post) and will include an `upload_url` which is a signed URL of the storage location for uploading your file to.

This URL is unique and publicly signed for a short time, so make sure to upload your files in a timely manner.

**Example flow using JavaScript and the Fetch API:**

**Request an upload URL**

```js // Step 1: Request an upload URL from your API const response = await fetch(

"https://api.postforme.dev/v1/media/create-upload-url",
{
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
}

);

const { media_url, upload_url } = await response.json(); ```

**Upload your file to the signed URL**

```js // Step 2: Upload your file to the signed URL const file = /* your File or Blob object, e.g., from an <input type="file"> */;

await fetch(upload_url, {
  method: 'PUT',
  headers: {
    'Content-Type': 'image/jpeg'
  },
  body: file
});

```

**Use the `media_url` when creating your post**

```js
// Step 3: Use the `media_url` when creating your post
const response = await fetch('https://api.postforme.dev/v1/social-posts', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    social_accounts: ['spc_...', ...],
    caption: 'My caption',
    media: [
      {
        url: media_url
      }
    ]
  })
});
```

type PinterestConfigurationDto

type PinterestConfigurationDto struct {
	// Pinterest board IDs
	BoardIDs []string `json:"board_ids,nullable"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Pinterest post link
	Link string `json:"link,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BoardIDs    respjson.Field
		Caption     respjson.Field
		Link        respjson.Field
		Media       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PinterestConfigurationDto) RawJSON

func (r PinterestConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (PinterestConfigurationDto) ToParam

ToParam converts this PinterestConfigurationDto to a PinterestConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PinterestConfigurationDtoParam.Overrides()

func (*PinterestConfigurationDto) UnmarshalJSON

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

type PinterestConfigurationDtoParam

type PinterestConfigurationDtoParam struct {
	// Pinterest post link
	Link param.Opt[string] `json:"link,omitzero"`
	// Pinterest board IDs
	BoardIDs []string `json:"board_ids,omitzero"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (PinterestConfigurationDtoParam) MarshalJSON

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

func (*PinterestConfigurationDtoParam) UnmarshalJSON

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

type PlatformConfigurationsDto

type PlatformConfigurationsDto struct {
	// Bluesky configuration
	Bluesky BlueskyConfigurationDto `json:"bluesky,nullable"`
	// Facebook configuration
	Facebook FacebookConfigurationDto `json:"facebook,nullable"`
	// Instagram configuration
	Instagram InstagramConfigurationDto `json:"instagram,nullable"`
	// LinkedIn configuration
	Linkedin LinkedinConfigurationDto `json:"linkedin,nullable"`
	// Pinterest configuration
	Pinterest PinterestConfigurationDto `json:"pinterest,nullable"`
	// Threads configuration
	Threads ThreadsConfigurationDto `json:"threads,nullable"`
	// TikTok configuration
	Tiktok TiktokConfiguration `json:"tiktok,nullable"`
	// TikTok configuration
	TiktokBusiness TiktokConfiguration `json:"tiktok_business,nullable"`
	// Twitter configuration
	X TwitterConfigurationDto `json:"x,nullable"`
	// YouTube configuration
	Youtube YoutubeConfigurationDto `json:"youtube,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bluesky        respjson.Field
		Facebook       respjson.Field
		Instagram      respjson.Field
		Linkedin       respjson.Field
		Pinterest      respjson.Field
		Threads        respjson.Field
		Tiktok         respjson.Field
		TiktokBusiness respjson.Field
		X              respjson.Field
		Youtube        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PlatformConfigurationsDto) RawJSON

func (r PlatformConfigurationsDto) RawJSON() string

Returns the unmodified JSON received from the API

func (PlatformConfigurationsDto) ToParam

ToParam converts this PlatformConfigurationsDto to a PlatformConfigurationsDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PlatformConfigurationsDtoParam.Overrides()

func (*PlatformConfigurationsDto) UnmarshalJSON

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

type PlatformConfigurationsDtoParam

type PlatformConfigurationsDtoParam struct {
	// Bluesky configuration
	Bluesky BlueskyConfigurationDtoParam `json:"bluesky,omitzero"`
	// Facebook configuration
	Facebook FacebookConfigurationDtoParam `json:"facebook,omitzero"`
	// Instagram configuration
	Instagram InstagramConfigurationDtoParam `json:"instagram,omitzero"`
	// LinkedIn configuration
	Linkedin LinkedinConfigurationDtoParam `json:"linkedin,omitzero"`
	// Pinterest configuration
	Pinterest PinterestConfigurationDtoParam `json:"pinterest,omitzero"`
	// Threads configuration
	Threads ThreadsConfigurationDtoParam `json:"threads,omitzero"`
	// TikTok configuration
	Tiktok TiktokConfigurationParam `json:"tiktok,omitzero"`
	// TikTok configuration
	TiktokBusiness TiktokConfigurationParam `json:"tiktok_business,omitzero"`
	// Twitter configuration
	X TwitterConfigurationDtoParam `json:"x,omitzero"`
	// YouTube configuration
	Youtube YoutubeConfigurationDtoParam `json:"youtube,omitzero"`
	// contains filtered or unexported fields
}

func (PlatformConfigurationsDtoParam) MarshalJSON

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

func (*PlatformConfigurationsDtoParam) UnmarshalJSON

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

type SocialAccount

type SocialAccount struct {
	// The unique identifier of the social account
	ID string `json:"id,required"`
	// The access token of the social account
	AccessToken string `json:"access_token,required"`
	// The access token expiration date of the social account
	AccessTokenExpiresAt time.Time `json:"access_token_expires_at,required" format:"date-time"`
	// The external id of the social account
	ExternalID string `json:"external_id,required"`
	// The metadata of the social account
	Metadata any `json:"metadata,required"`
	// The platform of the social account
	Platform string `json:"platform,required"`
	// The refresh token of the social account
	RefreshToken string `json:"refresh_token,required"`
	// The refresh token expiration date of the social account
	RefreshTokenExpiresAt time.Time `json:"refresh_token_expires_at,required" format:"date-time"`
	// Status of the account
	//
	// Any of "connected", "disconnected".
	Status SocialAccountStatus `json:"status,required"`
	// The platform's id of the social account
	UserID string `json:"user_id,required"`
	// The platform's username of the social account
	Username string `json:"username,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		AccessToken           respjson.Field
		AccessTokenExpiresAt  respjson.Field
		ExternalID            respjson.Field
		Metadata              respjson.Field
		Platform              respjson.Field
		RefreshToken          respjson.Field
		RefreshTokenExpiresAt respjson.Field
		Status                respjson.Field
		UserID                respjson.Field
		Username              respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialAccount) RawJSON

func (r SocialAccount) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialAccount) UnmarshalJSON

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

type SocialAccountDisconnectResponse

type SocialAccountDisconnectResponse struct {
	// The unique identifier of the social account
	ID string `json:"id,required"`
	// The access token of the social account
	AccessToken string `json:"access_token,required"`
	// The access token expiration date of the social account
	AccessTokenExpiresAt time.Time `json:"access_token_expires_at,required" format:"date-time"`
	// The external id of the social account
	ExternalID string `json:"external_id,required"`
	// The metadata of the social account
	Metadata any `json:"metadata,required"`
	// The platform of the social account
	Platform string `json:"platform,required"`
	// The refresh token of the social account
	RefreshToken string `json:"refresh_token,required"`
	// The refresh token expiration date of the social account
	RefreshTokenExpiresAt time.Time `json:"refresh_token_expires_at,required" format:"date-time"`
	// Status of the account
	//
	// Any of "disconnected".
	Status SocialAccountDisconnectResponseStatus `json:"status,required"`
	// The platform's id of the social account
	UserID string `json:"user_id,required"`
	// The platform's username of the social account
	Username string `json:"username,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		AccessToken           respjson.Field
		AccessTokenExpiresAt  respjson.Field
		ExternalID            respjson.Field
		Metadata              respjson.Field
		Platform              respjson.Field
		RefreshToken          respjson.Field
		RefreshTokenExpiresAt respjson.Field
		Status                respjson.Field
		UserID                respjson.Field
		Username              respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialAccountDisconnectResponse) RawJSON

Returns the unmodified JSON received from the API

func (*SocialAccountDisconnectResponse) UnmarshalJSON

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

type SocialAccountDisconnectResponseStatus

type SocialAccountDisconnectResponseStatus string

Status of the account

const (
	SocialAccountDisconnectResponseStatusDisconnected SocialAccountDisconnectResponseStatus = "disconnected"
)

type SocialAccountListParams

type SocialAccountListParams struct {
	// Number of items to return
	Limit param.Opt[float64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip
	Offset param.Opt[float64] `query:"offset,omitzero" json:"-"`
	// Filter by id(s). Multiple values imply OR logic (e.g.,
	// ?id=spc_xxxxxx&id=spc_yyyyyy).
	ID []string `query:"id,omitzero" json:"-"`
	// Filter by externalId(s). Multiple values imply OR logic (e.g.,
	// ?externalId=test&externalId=test2).
	ExternalID []string `query:"external_id,omitzero" json:"-"`
	// Filter by platform(s). Multiple values imply OR logic (e.g.,
	// ?platform=x&platform=facebook).
	Platform []string `query:"platform,omitzero" json:"-"`
	// Filter by username(s). Multiple values imply OR logic (e.g.,
	// ?username=test&username=test2).
	Username []string `query:"username,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SocialAccountListParams) URLQuery

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

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

type SocialAccountListResponse

type SocialAccountListResponse struct {
	Data []SocialAccount               `json:"data,required"`
	Meta SocialAccountListResponseMeta `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 (SocialAccountListResponse) RawJSON

func (r SocialAccountListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialAccountListResponse) UnmarshalJSON

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

type SocialAccountListResponseMeta

type SocialAccountListResponseMeta struct {
	// Maximum number of items returned.
	Limit float64 `json:"limit,required"`
	// URL to the next page of results, or null if none.
	Next string `json:"next,required"`
	// Number of items skipped.
	Offset float64 `json:"offset,required"`
	// Total number of items available.
	Total float64 `json:"total,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Limit       respjson.Field
		Next        respjson.Field
		Offset      respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialAccountListResponseMeta) RawJSON

Returns the unmodified JSON received from the API

func (*SocialAccountListResponseMeta) UnmarshalJSON

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

type SocialAccountNewAuthURLParams

type SocialAccountNewAuthURLParams struct {
	// The social account provider
	Platform string `json:"platform,required"`
	// Your unique identifier for the social account
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// Additional data needed for the provider
	PlatformData SocialAccountNewAuthURLParamsPlatformData `json:"platform_data,omitzero"`
	// contains filtered or unexported fields
}

func (SocialAccountNewAuthURLParams) MarshalJSON

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

func (*SocialAccountNewAuthURLParams) UnmarshalJSON

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

type SocialAccountNewAuthURLParamsPlatformData

type SocialAccountNewAuthURLParamsPlatformData struct {
	// Additional data needed for connecting bluesky accounts
	Bluesky SocialAccountNewAuthURLParamsPlatformDataBluesky `json:"bluesky,omitzero"`
	// Additional data for connecting linkedin accounts
	Linkedin SocialAccountNewAuthURLParamsPlatformDataLinkedin `json:"linkedin,omitzero"`
	// contains filtered or unexported fields
}

Additional data needed for the provider

func (SocialAccountNewAuthURLParamsPlatformData) MarshalJSON

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

func (*SocialAccountNewAuthURLParamsPlatformData) UnmarshalJSON

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

type SocialAccountNewAuthURLParamsPlatformDataBluesky

type SocialAccountNewAuthURLParamsPlatformDataBluesky struct {
	// The app password of the account
	AppPassword string `json:"app_password,required"`
	// The handle of the account
	Handle string `json:"handle,required"`
	// contains filtered or unexported fields
}

Additional data needed for connecting bluesky accounts

The properties AppPassword, Handle are required.

func (SocialAccountNewAuthURLParamsPlatformDataBluesky) MarshalJSON

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

func (*SocialAccountNewAuthURLParamsPlatformDataBluesky) UnmarshalJSON

type SocialAccountNewAuthURLParamsPlatformDataLinkedin

type SocialAccountNewAuthURLParamsPlatformDataLinkedin struct {
	// The type of connection; personal for posting on behalf of the user only,
	// organization for posting on behalf of both an organization and the user
	//
	// Any of "personal", "organization".
	ConnectionType string `json:"connection_type,omitzero,required"`
	// contains filtered or unexported fields
}

Additional data for connecting linkedin accounts

The property ConnectionType is required.

func (SocialAccountNewAuthURLParamsPlatformDataLinkedin) MarshalJSON

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

func (*SocialAccountNewAuthURLParamsPlatformDataLinkedin) UnmarshalJSON

type SocialAccountNewAuthURLResponse

type SocialAccountNewAuthURLResponse struct {
	// The social account provider
	Platform string `json:"platform,required"`
	// The url to redirect the user to, in order to connect their account
	URL string `json:"url,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Platform    respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialAccountNewAuthURLResponse) RawJSON

Returns the unmodified JSON received from the API

func (*SocialAccountNewAuthURLResponse) UnmarshalJSON

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

type SocialAccountNewParams

type SocialAccountNewParams struct {
	// The access token of the social account
	AccessToken string `json:"access_token,required"`
	// The access token expiration date of the social account
	AccessTokenExpiresAt time.Time `json:"access_token_expires_at,required" format:"date-time"`
	// The platform of the social account
	//
	// Any of "facebook", "instagram", "x", "tiktok", "youtube", "pinterest",
	// "linkedin", "bluesky", "threads", "tiktok_business".
	Platform SocialAccountNewParamsPlatform `json:"platform,omitzero,required"`
	// The user id of the social account
	UserID string `json:"user_id,required"`
	// The external id of the social account
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// The refresh token of the social account
	RefreshToken param.Opt[string] `json:"refresh_token,omitzero"`
	// The refresh token expiration date of the social account
	RefreshTokenExpiresAt param.Opt[time.Time] `json:"refresh_token_expires_at,omitzero" format:"date-time"`
	// The platform's username of the social account
	Username param.Opt[string] `json:"username,omitzero"`
	// The metadata of the social account
	Metadata any `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (SocialAccountNewParams) MarshalJSON

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

func (*SocialAccountNewParams) UnmarshalJSON

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

type SocialAccountNewParamsPlatform

type SocialAccountNewParamsPlatform string

The platform of the social account

const (
	SocialAccountNewParamsPlatformFacebook       SocialAccountNewParamsPlatform = "facebook"
	SocialAccountNewParamsPlatformInstagram      SocialAccountNewParamsPlatform = "instagram"
	SocialAccountNewParamsPlatformX              SocialAccountNewParamsPlatform = "x"
	SocialAccountNewParamsPlatformTiktok         SocialAccountNewParamsPlatform = "tiktok"
	SocialAccountNewParamsPlatformYoutube        SocialAccountNewParamsPlatform = "youtube"
	SocialAccountNewParamsPlatformPinterest      SocialAccountNewParamsPlatform = "pinterest"
	SocialAccountNewParamsPlatformLinkedin       SocialAccountNewParamsPlatform = "linkedin"
	SocialAccountNewParamsPlatformBluesky        SocialAccountNewParamsPlatform = "bluesky"
	SocialAccountNewParamsPlatformThreads        SocialAccountNewParamsPlatform = "threads"
	SocialAccountNewParamsPlatformTiktokBusiness SocialAccountNewParamsPlatform = "tiktok_business"
)

type SocialAccountService

type SocialAccountService struct {
	Options []option.RequestOption
}

SocialAccountService contains methods and other services that help with interacting with the post-for-me 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 NewSocialAccountService method instead.

func NewSocialAccountService

func NewSocialAccountService(opts ...option.RequestOption) (r SocialAccountService)

NewSocialAccountService 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 (*SocialAccountService) Disconnect

Disconnecting an account with remove all auth tokens and mark the account as disconnected. The record of the account will be kept and can be retrieved and reconnected by the owner of the account.

func (*SocialAccountService) Get

func (r *SocialAccountService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *SocialAccount, err error)

Get social account by ID

func (*SocialAccountService) List

Get a paginated result for social accounts based on the applied filters

func (*SocialAccountService) New

If a social account with the same platform and user_id already exists, it will be updated. If not, a new social account will be created.

func (*SocialAccountService) NewAuthURL

Generates a URL that initiates the authentication flow for a user's social media account. When visited, the user is redirected to the selected social platform's login/authorization page. Upon successful authentication, they are redirected back to your application

func (*SocialAccountService) Update

Update social account

type SocialAccountStatus

type SocialAccountStatus string

Status of the account

const (
	SocialAccountStatusConnected    SocialAccountStatus = "connected"
	SocialAccountStatusDisconnected SocialAccountStatus = "disconnected"
)

type SocialAccountUpdateParams

type SocialAccountUpdateParams struct {
	// The platform's external id of the social account
	ExternalID param.Opt[string] `json:"external_id,omitzero"`
	// The platform's username of the social account
	Username param.Opt[string] `json:"username,omitzero"`
	// contains filtered or unexported fields
}

func (SocialAccountUpdateParams) MarshalJSON

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

func (*SocialAccountUpdateParams) UnmarshalJSON

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

type SocialPost

type SocialPost struct {
	// Unique identifier of the post
	ID string `json:"id,required"`
	// Account-specific configurations for the post
	AccountConfigurations []SocialPostAccountConfiguration `json:"account_configurations,required"`
	// Caption text for the post
	Caption string `json:"caption,required"`
	// Timestamp when the post was created
	CreatedAt string `json:"created_at,required"`
	// Provided unique identifier of the post
	ExternalID string `json:"external_id,required"`
	// Array of media URLs associated with the post
	Media []SocialPostMedia `json:"media,required"`
	// Platform-specific configurations for the post
	PlatformConfigurations PlatformConfigurationsDto `json:"platform_configurations,required"`
	// Scheduled date and time for the post
	ScheduledAt string `json:"scheduled_at,required"`
	// Array of social account IDs for posting
	SocialAccounts []SocialAccount `json:"social_accounts,required"`
	// Current status of the post: draft, processed, scheduled, or processing
	//
	// Any of "draft", "scheduled", "processing", "processed".
	Status SocialPostStatus `json:"status,required"`
	// Timestamp when the post was last updated
	UpdatedAt string `json:"updated_at,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		AccountConfigurations  respjson.Field
		Caption                respjson.Field
		CreatedAt              respjson.Field
		ExternalID             respjson.Field
		Media                  respjson.Field
		PlatformConfigurations respjson.Field
		ScheduledAt            respjson.Field
		SocialAccounts         respjson.Field
		Status                 respjson.Field
		UpdatedAt              respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPost) RawJSON

func (r SocialPost) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPost) UnmarshalJSON

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

type SocialPostAccountConfiguration

type SocialPostAccountConfiguration struct {
	// Configuration for the social account
	Configuration SocialPostAccountConfigurationConfiguration `json:"configuration,required"`
	// ID of the social account, you want to apply the configuration to
	SocialAccountID string `json:"social_account_id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configuration   respjson.Field
		SocialAccountID respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostAccountConfiguration) RawJSON

Returns the unmodified JSON received from the API

func (*SocialPostAccountConfiguration) UnmarshalJSON

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

type SocialPostAccountConfigurationConfiguration

type SocialPostAccountConfigurationConfiguration struct {
	// Allow comments on TikTok
	AllowComment bool `json:"allow_comment,nullable"`
	// Allow duets on TikTok
	AllowDuet bool `json:"allow_duet,nullable"`
	// Allow stitch on TikTok
	AllowStitch bool `json:"allow_stitch,nullable"`
	// Pinterest board IDs
	BoardIDs []string `json:"board_ids,nullable"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Disclose branded content on TikTok
	DiscloseBrandedContent bool `json:"disclose_branded_content,nullable"`
	// Disclose your brand on TikTok
	DiscloseYourBrand bool `json:"disclose_your_brand,nullable"`
	// Flag content as AI generated on TikTok
	IsAIGenerated bool `json:"is_ai_generated,nullable"`
	// Will create a draft upload to TikTok, posting will need to be completed from
	// within the app
	IsDraft bool `json:"is_draft,nullable"`
	// Pinterest post link
	Link string `json:"link,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Post placement for Facebook/Instagram/Threads
	//
	// Any of "reels", "timeline", "stories".
	Placement string `json:"placement,nullable"`
	// Sets the privacy status for TikTok (private, public)
	PrivacyStatus string `json:"privacy_status,nullable"`
	// Overrides the `title` from the post
	Title string `json:"title,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowComment           respjson.Field
		AllowDuet              respjson.Field
		AllowStitch            respjson.Field
		BoardIDs               respjson.Field
		Caption                respjson.Field
		DiscloseBrandedContent respjson.Field
		DiscloseYourBrand      respjson.Field
		IsAIGenerated          respjson.Field
		IsDraft                respjson.Field
		Link                   respjson.Field
		Media                  respjson.Field
		Placement              respjson.Field
		PrivacyStatus          respjson.Field
		Title                  respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configuration for the social account

func (SocialPostAccountConfigurationConfiguration) RawJSON

Returns the unmodified JSON received from the API

func (*SocialPostAccountConfigurationConfiguration) UnmarshalJSON

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

type SocialPostDeleteResponse

type SocialPostDeleteResponse struct {
	// Whether or not the entity was deleted
	Success bool `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostDeleteResponse) RawJSON

func (r SocialPostDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPostDeleteResponse) UnmarshalJSON

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

type SocialPostListParams

type SocialPostListParams struct {
	// Number of items to return
	Limit param.Opt[float64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip
	Offset param.Opt[float64] `query:"offset,omitzero" json:"-"`
	// Filter by external ID. Multiple values imply OR logic.
	ExternalID []string `query:"external_id,omitzero" json:"-"`
	// Filter by platforms. Multiple values imply OR logic.
	//
	// Any of "bluesky", "facebook", "instagram", "linkedin", "pinterest", "threads",
	// "tiktok", "x", "youtube".
	Platform []string `query:"platform,omitzero" json:"-"`
	// Filter by post status. Multiple values imply OR logic.
	//
	// Any of "draft", "scheduled", "processing", "processed".
	Status []string `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SocialPostListParams) URLQuery

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

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

type SocialPostListResponse

type SocialPostListResponse struct {
	Data []SocialPost               `json:"data,required"`
	Meta SocialPostListResponseMeta `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 (SocialPostListResponse) RawJSON

func (r SocialPostListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPostListResponse) UnmarshalJSON

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

type SocialPostListResponseMeta

type SocialPostListResponseMeta struct {
	// Maximum number of items returned.
	Limit float64 `json:"limit,required"`
	// URL to the next page of results, or null if none.
	Next string `json:"next,required"`
	// Number of items skipped.
	Offset float64 `json:"offset,required"`
	// Total number of items available.
	Total float64 `json:"total,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Limit       respjson.Field
		Next        respjson.Field
		Offset      respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostListResponseMeta) RawJSON

func (r SocialPostListResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPostListResponseMeta) UnmarshalJSON

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

type SocialPostMedia

type SocialPostMedia struct {
	// Public URL of the media
	URL string `json:"url,required"`
	// Timestamp in milliseconds of frame to use as thumbnail for the media
	ThumbnailTimestampMs any `json:"thumbnail_timestamp_ms,nullable"`
	// Public URL of the thumbnail for the media
	ThumbnailURL any `json:"thumbnail_url,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL                  respjson.Field
		ThumbnailTimestampMs respjson.Field
		ThumbnailURL         respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostMedia) RawJSON

func (r SocialPostMedia) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPostMedia) UnmarshalJSON

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

type SocialPostNewParams

type SocialPostNewParams struct {
	CreateSocialPost CreateSocialPostParam
	// contains filtered or unexported fields
}

func (SocialPostNewParams) MarshalJSON

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

func (*SocialPostNewParams) UnmarshalJSON

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

type SocialPostResult

type SocialPostResult struct {
	// The unique identifier of the post result
	ID string `json:"id,required"`
	// Detailed logs from the post
	Details any `json:"details,required"`
	// Error message if the post failed
	Error any `json:"error,required"`
	// Platform-specific data
	PlatformData SocialPostResultPlatformData `json:"platform_data,required"`
	// The ID of the associated post
	PostID string `json:"post_id,required"`
	// The ID of the associated social account
	SocialAccountID string `json:"social_account_id,required"`
	// Indicates if the post was successful
	Success bool `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Details         respjson.Field
		Error           respjson.Field
		PlatformData    respjson.Field
		PostID          respjson.Field
		SocialAccountID respjson.Field
		Success         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostResult) RawJSON

func (r SocialPostResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialPostResult) UnmarshalJSON

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

type SocialPostResultListParams

type SocialPostResultListParams struct {
	// Number of items to return
	Limit param.Opt[float64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip
	Offset param.Opt[float64] `query:"offset,omitzero" json:"-"`
	// Filter by platform(s). Multiple values imply OR logic (e.g.,
	// ?platform=x&platform=facebook).
	Platform []string `query:"platform,omitzero" json:"-"`
	// Filter by post IDs. Multiple values imply OR logic (e.g.,
	// ?post_id=123&post_id=456).
	PostID []string `query:"post_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SocialPostResultListParams) URLQuery

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

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

type SocialPostResultListResponse

type SocialPostResultListResponse struct {
	Data []SocialPostResult               `json:"data,required"`
	Meta SocialPostResultListResponseMeta `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 (SocialPostResultListResponse) RawJSON

Returns the unmodified JSON received from the API

func (*SocialPostResultListResponse) UnmarshalJSON

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

type SocialPostResultListResponseMeta

type SocialPostResultListResponseMeta struct {
	// Maximum number of items returned.
	Limit float64 `json:"limit,required"`
	// URL to the next page of results, or null if none.
	Next string `json:"next,required"`
	// Number of items skipped.
	Offset float64 `json:"offset,required"`
	// Total number of items available.
	Total float64 `json:"total,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Limit       respjson.Field
		Next        respjson.Field
		Offset      respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SocialPostResultListResponseMeta) RawJSON

Returns the unmodified JSON received from the API

func (*SocialPostResultListResponseMeta) UnmarshalJSON

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

type SocialPostResultPlatformData

type SocialPostResultPlatformData struct {
	// Platform-specific ID
	ID string `json:"id"`
	// URL of the posted content
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Platform-specific data

func (SocialPostResultPlatformData) RawJSON

Returns the unmodified JSON received from the API

func (*SocialPostResultPlatformData) UnmarshalJSON

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

type SocialPostResultService

type SocialPostResultService struct {
	Options []option.RequestOption
}

SocialPostResultService contains methods and other services that help with interacting with the post-for-me 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 NewSocialPostResultService method instead.

func NewSocialPostResultService

func NewSocialPostResultService(opts ...option.RequestOption) (r SocialPostResultService)

NewSocialPostResultService 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 (*SocialPostResultService) Get

Get post result by ID

func (*SocialPostResultService) List

Get a paginated result for post results based on the applied filters

type SocialPostService

type SocialPostService struct {
	Options []option.RequestOption
}

SocialPostService contains methods and other services that help with interacting with the post-for-me 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 NewSocialPostService method instead.

func NewSocialPostService

func NewSocialPostService(opts ...option.RequestOption) (r SocialPostService)

NewSocialPostService 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 (*SocialPostService) Delete

Delete Post

func (*SocialPostService) Get

func (r *SocialPostService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *SocialPost, err error)

Get Post by ID

func (*SocialPostService) List

Get a paginated result for posts based on the applied filters

func (*SocialPostService) New

Create Post

func (*SocialPostService) Update

func (r *SocialPostService) Update(ctx context.Context, id string, body SocialPostUpdateParams, opts ...option.RequestOption) (res *SocialPost, err error)

Update Post

type SocialPostStatus

type SocialPostStatus string

Current status of the post: draft, processed, scheduled, or processing

const (
	SocialPostStatusDraft      SocialPostStatus = "draft"
	SocialPostStatusScheduled  SocialPostStatus = "scheduled"
	SocialPostStatusProcessing SocialPostStatus = "processing"
	SocialPostStatusProcessed  SocialPostStatus = "processed"
)

type SocialPostUpdateParams

type SocialPostUpdateParams struct {
	CreateSocialPost CreateSocialPostParam
	// contains filtered or unexported fields
}

func (SocialPostUpdateParams) MarshalJSON

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

func (*SocialPostUpdateParams) UnmarshalJSON

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

type ThreadsConfigurationDto

type ThreadsConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Threads post placement
	//
	// Any of "reels", "timeline".
	Placement ThreadsConfigurationDtoPlacement `json:"placement,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		Placement   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ThreadsConfigurationDto) RawJSON

func (r ThreadsConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (ThreadsConfigurationDto) ToParam

ToParam converts this ThreadsConfigurationDto to a ThreadsConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ThreadsConfigurationDtoParam.Overrides()

func (*ThreadsConfigurationDto) UnmarshalJSON

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

type ThreadsConfigurationDtoParam

type ThreadsConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// Threads post placement
	//
	// Any of "reels", "timeline".
	Placement ThreadsConfigurationDtoPlacement `json:"placement,omitzero"`
	// contains filtered or unexported fields
}

func (ThreadsConfigurationDtoParam) MarshalJSON

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

func (*ThreadsConfigurationDtoParam) UnmarshalJSON

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

type ThreadsConfigurationDtoPlacement

type ThreadsConfigurationDtoPlacement string

Threads post placement

const (
	ThreadsConfigurationDtoPlacementReels    ThreadsConfigurationDtoPlacement = "reels"
	ThreadsConfigurationDtoPlacementTimeline ThreadsConfigurationDtoPlacement = "timeline"
)

type TiktokConfiguration

type TiktokConfiguration struct {
	// Allow comments on TikTok
	AllowComment bool `json:"allow_comment,nullable"`
	// Allow duets on TikTok
	AllowDuet bool `json:"allow_duet,nullable"`
	// Allow stitch on TikTok
	AllowStitch bool `json:"allow_stitch,nullable"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Disclose branded content on TikTok
	DiscloseBrandedContent bool `json:"disclose_branded_content,nullable"`
	// Disclose your brand on TikTok
	DiscloseYourBrand bool `json:"disclose_your_brand,nullable"`
	// Flag content as AI generated on TikTok
	IsAIGenerated bool `json:"is_ai_generated,nullable"`
	// Will create a draft upload to TikTok, posting will need to be completed from
	// within the app
	IsDraft bool `json:"is_draft,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Sets the privacy status for TikTok (private, public)
	PrivacyStatus string `json:"privacy_status,nullable"`
	// Overrides the `title` from the post
	Title string `json:"title,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowComment           respjson.Field
		AllowDuet              respjson.Field
		AllowStitch            respjson.Field
		Caption                respjson.Field
		DiscloseBrandedContent respjson.Field
		DiscloseYourBrand      respjson.Field
		IsAIGenerated          respjson.Field
		IsDraft                respjson.Field
		Media                  respjson.Field
		PrivacyStatus          respjson.Field
		Title                  respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TiktokConfiguration) RawJSON

func (r TiktokConfiguration) RawJSON() string

Returns the unmodified JSON received from the API

func (TiktokConfiguration) ToParam

ToParam converts this TiktokConfiguration to a TiktokConfigurationParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TiktokConfigurationParam.Overrides()

func (*TiktokConfiguration) UnmarshalJSON

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

type TiktokConfigurationParam

type TiktokConfigurationParam struct {
	// Allow comments on TikTok
	AllowComment param.Opt[bool] `json:"allow_comment,omitzero"`
	// Allow duets on TikTok
	AllowDuet param.Opt[bool] `json:"allow_duet,omitzero"`
	// Allow stitch on TikTok
	AllowStitch param.Opt[bool] `json:"allow_stitch,omitzero"`
	// Disclose branded content on TikTok
	DiscloseBrandedContent param.Opt[bool] `json:"disclose_branded_content,omitzero"`
	// Disclose your brand on TikTok
	DiscloseYourBrand param.Opt[bool] `json:"disclose_your_brand,omitzero"`
	// Flag content as AI generated on TikTok
	IsAIGenerated param.Opt[bool] `json:"is_ai_generated,omitzero"`
	// Will create a draft upload to TikTok, posting will need to be completed from
	// within the app
	IsDraft param.Opt[bool] `json:"is_draft,omitzero"`
	// Sets the privacy status for TikTok (private, public)
	PrivacyStatus param.Opt[string] `json:"privacy_status,omitzero"`
	// Overrides the `title` from the post
	Title param.Opt[string] `json:"title,omitzero"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (TiktokConfigurationParam) MarshalJSON

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

func (*TiktokConfigurationParam) UnmarshalJSON

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

type TwitterConfigurationDto

type TwitterConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TwitterConfigurationDto) RawJSON

func (r TwitterConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (TwitterConfigurationDto) ToParam

ToParam converts this TwitterConfigurationDto to a TwitterConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TwitterConfigurationDtoParam.Overrides()

func (*TwitterConfigurationDto) UnmarshalJSON

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

type TwitterConfigurationDtoParam

type TwitterConfigurationDtoParam struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (TwitterConfigurationDtoParam) MarshalJSON

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

func (*TwitterConfigurationDtoParam) UnmarshalJSON

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

type YoutubeConfigurationDto

type YoutubeConfigurationDto struct {
	// Overrides the `caption` from the post
	Caption any `json:"caption,nullable"`
	// Overrides the `media` from the post
	Media []string `json:"media,nullable"`
	// Overrides the `title` from the post
	Title string `json:"title,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Caption     respjson.Field
		Media       respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (YoutubeConfigurationDto) RawJSON

func (r YoutubeConfigurationDto) RawJSON() string

Returns the unmodified JSON received from the API

func (YoutubeConfigurationDto) ToParam

ToParam converts this YoutubeConfigurationDto to a YoutubeConfigurationDtoParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with YoutubeConfigurationDtoParam.Overrides()

func (*YoutubeConfigurationDto) UnmarshalJSON

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

type YoutubeConfigurationDtoParam

type YoutubeConfigurationDtoParam struct {
	// Overrides the `title` from the post
	Title param.Opt[string] `json:"title,omitzero"`
	// Overrides the `caption` from the post
	Caption any `json:"caption,omitzero"`
	// Overrides the `media` from the post
	Media []string `json:"media,omitzero"`
	// contains filtered or unexported fields
}

func (YoutubeConfigurationDtoParam) MarshalJSON

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

func (*YoutubeConfigurationDtoParam) UnmarshalJSON

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

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.21, 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.21, 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