diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fc4483c..88806d64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1,11 @@ # Change Log -## v0.16.0 +## v0.16.1 -* Added ability to create columns and indexes synchronously while creating a table -* Breaking change: `Output` enum has been removed; use `ImageFormat` instead. -* Add `getQueueAudits` support to `Health` service. -* Add longtext/mediumtext/text/varchar attribute and column helpers to `Databases` and `TablesDB` services. - -## v0.15.0 - -* Rename `VCSDeploymentType` enum to `VCSReferenceType` -* Change `CreateTemplateDeployment` method signature: replace `Version` parameter with `Type` (TemplateReferenceType) and `Reference` parameters -* Add `GetScreenshot` method to `Avatars` service -* Add `Theme`, `Timezone` and `Output` enums +* Update SDK as per latest server specs, these include - + * Introduces Backups module for managing Database backups + * Introduces Organization module + * Introduce Account level keys, Backup Service & Models ## v0.14.0 @@ -66,4 +59,4 @@ ## 0.3.0 -* Add new push message parameters \ No newline at end of file +* Add new push message parameters diff --git a/account/account.go b/account/account.go index fd68baaf..c8900d74 100644 --- a/account/account.go +++ b/account/account.go @@ -319,6 +319,253 @@ func (srv *Account) CreateJWT(optionalSetters ...CreateJWTOption)(*models.Jwt, e } return &parsed, nil +} +type ListKeysOptions struct { + Total bool + enabledSetters map[string]bool +} +func (options ListKeysOptions) New() *ListKeysOptions { + options.enabledSetters = map[string]bool{ + "Total": false, + } + return &options +} +type ListKeysOption func(*ListKeysOptions) +func (srv *Account) WithListKeysTotal(v bool) ListKeysOption { + return func(o *ListKeysOptions) { + o.Total = v + o.enabledSetters["Total"] = true + } +} + +// ListKeys get a list of all API keys from the current account. +func (srv *Account) ListKeys(optionalSetters ...ListKeysOption)(*models.KeyList, error) { + path := "/account/keys" + options := ListKeysOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Total"] { + params["total"] = options.Total + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.KeyList{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.KeyList + parsed, ok := resp.Result.(models.KeyList) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type CreateKeyOptions struct { + Expire string + enabledSetters map[string]bool +} +func (options CreateKeyOptions) New() *CreateKeyOptions { + options.enabledSetters = map[string]bool{ + "Expire": false, + } + return &options +} +type CreateKeyOption func(*CreateKeyOptions) +func (srv *Account) WithCreateKeyExpire(v string) CreateKeyOption { + return func(o *CreateKeyOptions) { + o.Expire = v + o.enabledSetters["Expire"] = true + } +} + +// CreateKey create a new account API key. +func (srv *Account) CreateKey(Name string, Scopes []string, optionalSetters ...CreateKeyOption)(*models.Key, error) { + path := "/account/keys" + options := CreateKeyOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["name"] = Name + params["scopes"] = Scopes + if options.enabledSetters["Expire"] { + params["expire"] = options.Expire + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("POST", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.Key{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.Key + parsed, ok := resp.Result.(models.Key) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// GetKey get a key by its unique ID. This endpoint returns details about a +// specific API key in your account including it's scopes. +func (srv *Account) GetKey(KeyId string)(*models.Key, error) { + r := strings.NewReplacer("{keyId}", KeyId) + path := r.Replace("/account/keys/{keyId}") + params := map[string]interface{}{} + params["keyId"] = KeyId + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.Key{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.Key + parsed, ok := resp.Result.(models.Key) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type UpdateKeyOptions struct { + Expire string + enabledSetters map[string]bool +} +func (options UpdateKeyOptions) New() *UpdateKeyOptions { + options.enabledSetters = map[string]bool{ + "Expire": false, + } + return &options +} +type UpdateKeyOption func(*UpdateKeyOptions) +func (srv *Account) WithUpdateKeyExpire(v string) UpdateKeyOption { + return func(o *UpdateKeyOptions) { + o.Expire = v + o.enabledSetters["Expire"] = true + } +} + +// UpdateKey update a key by its unique ID. Use this endpoint to update the +// name, scopes, or expiration time of an API key. +func (srv *Account) UpdateKey(KeyId string, Name string, Scopes []string, optionalSetters ...UpdateKeyOption)(*models.Key, error) { + r := strings.NewReplacer("{keyId}", KeyId) + path := r.Replace("/account/keys/{keyId}") + options := UpdateKeyOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["keyId"] = KeyId + params["name"] = Name + params["scopes"] = Scopes + if options.enabledSetters["Expire"] { + params["expire"] = options.Expire + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("PUT", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.Key{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.Key + parsed, ok := resp.Result.(models.Key) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// DeleteKey delete a key by its unique ID. Once deleted, the key can no +// longer be used to authenticate API calls. +func (srv *Account) DeleteKey(KeyId string)(*interface{}, error) { + r := strings.NewReplacer("{keyId}", KeyId) + path := r.Replace("/account/keys/{keyId}") + params := map[string]interface{}{} + params["keyId"] = KeyId + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("DELETE", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + var parsed interface{} + + err = json.Unmarshal(bytes, &parsed) + if err != nil { + return nil, err + } + return &parsed, nil + } + var parsed interface{} + parsed, ok := resp.Result.(interface{}) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + } type ListLogsOptions struct { Queries []string diff --git a/appwrite/appwrite.go b/appwrite/appwrite.go index e82e1a86..312ca531 100644 --- a/appwrite/appwrite.go +++ b/appwrite/appwrite.go @@ -6,12 +6,14 @@ import ( "github.com/appwrite/sdk-for-go/client" "github.com/appwrite/sdk-for-go/account" "github.com/appwrite/sdk-for-go/avatars" + "github.com/appwrite/sdk-for-go/backups" "github.com/appwrite/sdk-for-go/databases" "github.com/appwrite/sdk-for-go/functions" "github.com/appwrite/sdk-for-go/graphql" "github.com/appwrite/sdk-for-go/health" "github.com/appwrite/sdk-for-go/locale" "github.com/appwrite/sdk-for-go/messaging" + "github.com/appwrite/sdk-for-go/organizations" "github.com/appwrite/sdk-for-go/sites" "github.com/appwrite/sdk-for-go/storage" "github.com/appwrite/sdk-for-go/tablesdb" @@ -26,6 +28,9 @@ func NewAccount(clt client.Client) *account.Account { func NewAvatars(clt client.Client) *avatars.Avatars { return avatars.New(clt) } +func NewBackups(clt client.Client) *backups.Backups { + return backups.New(clt) +} func NewDatabases(clt client.Client) *databases.Databases { return databases.New(clt) } @@ -44,6 +49,9 @@ func NewLocale(clt client.Client) *locale.Locale { func NewMessaging(clt client.Client) *messaging.Messaging { return messaging.New(clt) } +func NewOrganizations(clt client.Client) *organizations.Organizations { + return organizations.New(clt) +} func NewSites(clt client.Client) *sites.Sites { return sites.New(clt) } diff --git a/backups/backups.go b/backups/backups.go new file mode 100644 index 00000000..9a66beaf --- /dev/null +++ b/backups/backups.go @@ -0,0 +1,663 @@ +package backups + +import ( + "encoding/json" + "errors" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/models" + "strings" +) + +// Backups service +type Backups struct { + client client.Client +} + +func New(clt client.Client) *Backups { + return &Backups{ + client: clt, + } +} + +type ListArchivesOptions struct { + Queries []string + enabledSetters map[string]bool +} +func (options ListArchivesOptions) New() *ListArchivesOptions { + options.enabledSetters = map[string]bool{ + "Queries": false, + } + return &options +} +type ListArchivesOption func(*ListArchivesOptions) +func (srv *Backups) WithListArchivesQueries(v []string) ListArchivesOption { + return func(o *ListArchivesOptions) { + o.Queries = v + o.enabledSetters["Queries"] = true + } +} + +// ListArchives list all archives for a project. +func (srv *Backups) ListArchives(optionalSetters ...ListArchivesOption)(*models.BackupArchiveList, error) { + path := "/backups/archives" + options := ListArchivesOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Queries"] { + params["queries"] = options.Queries + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupArchiveList{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupArchiveList + parsed, ok := resp.Result.(models.BackupArchiveList) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type CreateArchiveOptions struct { + ResourceId string + enabledSetters map[string]bool +} +func (options CreateArchiveOptions) New() *CreateArchiveOptions { + options.enabledSetters = map[string]bool{ + "ResourceId": false, + } + return &options +} +type CreateArchiveOption func(*CreateArchiveOptions) +func (srv *Backups) WithCreateArchiveResourceId(v string) CreateArchiveOption { + return func(o *CreateArchiveOptions) { + o.ResourceId = v + o.enabledSetters["ResourceId"] = true + } +} + +// CreateArchive create a new archive asynchronously for a project. +func (srv *Backups) CreateArchive(Services []string, optionalSetters ...CreateArchiveOption)(*models.BackupArchive, error) { + path := "/backups/archives" + options := CreateArchiveOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["services"] = Services + if options.enabledSetters["ResourceId"] { + params["resourceId"] = options.ResourceId + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("POST", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupArchive{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupArchive + parsed, ok := resp.Result.(models.BackupArchive) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// GetArchive get a backup archive using it's ID. +func (srv *Backups) GetArchive(ArchiveId string)(*models.BackupArchive, error) { + r := strings.NewReplacer("{archiveId}", ArchiveId) + path := r.Replace("/backups/archives/{archiveId}") + params := map[string]interface{}{} + params["archiveId"] = ArchiveId + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupArchive{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupArchive + parsed, ok := resp.Result.(models.BackupArchive) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// DeleteArchive delete an existing archive for a project. +func (srv *Backups) DeleteArchive(ArchiveId string)(*interface{}, error) { + r := strings.NewReplacer("{archiveId}", ArchiveId) + path := r.Replace("/backups/archives/{archiveId}") + params := map[string]interface{}{} + params["archiveId"] = ArchiveId + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("DELETE", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + var parsed interface{} + + err = json.Unmarshal(bytes, &parsed) + if err != nil { + return nil, err + } + return &parsed, nil + } + var parsed interface{} + parsed, ok := resp.Result.(interface{}) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type ListPoliciesOptions struct { + Queries []string + enabledSetters map[string]bool +} +func (options ListPoliciesOptions) New() *ListPoliciesOptions { + options.enabledSetters = map[string]bool{ + "Queries": false, + } + return &options +} +type ListPoliciesOption func(*ListPoliciesOptions) +func (srv *Backups) WithListPoliciesQueries(v []string) ListPoliciesOption { + return func(o *ListPoliciesOptions) { + o.Queries = v + o.enabledSetters["Queries"] = true + } +} + +// ListPolicies list all policies for a project. +func (srv *Backups) ListPolicies(optionalSetters ...ListPoliciesOption)(*models.BackupPolicyList, error) { + path := "/backups/policies" + options := ListPoliciesOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Queries"] { + params["queries"] = options.Queries + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupPolicyList{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupPolicyList + parsed, ok := resp.Result.(models.BackupPolicyList) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type CreatePolicyOptions struct { + Name string + ResourceId string + Enabled bool + enabledSetters map[string]bool +} +func (options CreatePolicyOptions) New() *CreatePolicyOptions { + options.enabledSetters = map[string]bool{ + "Name": false, + "ResourceId": false, + "Enabled": false, + } + return &options +} +type CreatePolicyOption func(*CreatePolicyOptions) +func (srv *Backups) WithCreatePolicyName(v string) CreatePolicyOption { + return func(o *CreatePolicyOptions) { + o.Name = v + o.enabledSetters["Name"] = true + } +} +func (srv *Backups) WithCreatePolicyResourceId(v string) CreatePolicyOption { + return func(o *CreatePolicyOptions) { + o.ResourceId = v + o.enabledSetters["ResourceId"] = true + } +} +func (srv *Backups) WithCreatePolicyEnabled(v bool) CreatePolicyOption { + return func(o *CreatePolicyOptions) { + o.Enabled = v + o.enabledSetters["Enabled"] = true + } +} + +// CreatePolicy create a new backup policy. +func (srv *Backups) CreatePolicy(PolicyId string, Services []string, Retention int, Schedule string, optionalSetters ...CreatePolicyOption)(*models.BackupPolicy, error) { + path := "/backups/policies" + options := CreatePolicyOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["policyId"] = PolicyId + params["services"] = Services + params["retention"] = Retention + params["schedule"] = Schedule + if options.enabledSetters["Name"] { + params["name"] = options.Name + } + if options.enabledSetters["ResourceId"] { + params["resourceId"] = options.ResourceId + } + if options.enabledSetters["Enabled"] { + params["enabled"] = options.Enabled + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("POST", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupPolicy{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupPolicy + parsed, ok := resp.Result.(models.BackupPolicy) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// GetPolicy get a backup policy using it's ID. +func (srv *Backups) GetPolicy(PolicyId string)(*models.BackupPolicy, error) { + r := strings.NewReplacer("{policyId}", PolicyId) + path := r.Replace("/backups/policies/{policyId}") + params := map[string]interface{}{} + params["policyId"] = PolicyId + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupPolicy{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupPolicy + parsed, ok := resp.Result.(models.BackupPolicy) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type UpdatePolicyOptions struct { + Name string + Retention int + Schedule string + Enabled bool + enabledSetters map[string]bool +} +func (options UpdatePolicyOptions) New() *UpdatePolicyOptions { + options.enabledSetters = map[string]bool{ + "Name": false, + "Retention": false, + "Schedule": false, + "Enabled": false, + } + return &options +} +type UpdatePolicyOption func(*UpdatePolicyOptions) +func (srv *Backups) WithUpdatePolicyName(v string) UpdatePolicyOption { + return func(o *UpdatePolicyOptions) { + o.Name = v + o.enabledSetters["Name"] = true + } +} +func (srv *Backups) WithUpdatePolicyRetention(v int) UpdatePolicyOption { + return func(o *UpdatePolicyOptions) { + o.Retention = v + o.enabledSetters["Retention"] = true + } +} +func (srv *Backups) WithUpdatePolicySchedule(v string) UpdatePolicyOption { + return func(o *UpdatePolicyOptions) { + o.Schedule = v + o.enabledSetters["Schedule"] = true + } +} +func (srv *Backups) WithUpdatePolicyEnabled(v bool) UpdatePolicyOption { + return func(o *UpdatePolicyOptions) { + o.Enabled = v + o.enabledSetters["Enabled"] = true + } +} + +// UpdatePolicy update an existing policy using it's ID. +func (srv *Backups) UpdatePolicy(PolicyId string, optionalSetters ...UpdatePolicyOption)(*models.BackupPolicy, error) { + r := strings.NewReplacer("{policyId}", PolicyId) + path := r.Replace("/backups/policies/{policyId}") + options := UpdatePolicyOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["policyId"] = PolicyId + if options.enabledSetters["Name"] { + params["name"] = options.Name + } + if options.enabledSetters["Retention"] { + params["retention"] = options.Retention + } + if options.enabledSetters["Schedule"] { + params["schedule"] = options.Schedule + } + if options.enabledSetters["Enabled"] { + params["enabled"] = options.Enabled + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("PATCH", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupPolicy{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupPolicy + parsed, ok := resp.Result.(models.BackupPolicy) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// DeletePolicy delete a policy using it's ID. +func (srv *Backups) DeletePolicy(PolicyId string)(*interface{}, error) { + r := strings.NewReplacer("{policyId}", PolicyId) + path := r.Replace("/backups/policies/{policyId}") + params := map[string]interface{}{} + params["policyId"] = PolicyId + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("DELETE", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + var parsed interface{} + + err = json.Unmarshal(bytes, &parsed) + if err != nil { + return nil, err + } + return &parsed, nil + } + var parsed interface{} + parsed, ok := resp.Result.(interface{}) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type CreateRestorationOptions struct { + NewResourceId string + NewResourceName string + enabledSetters map[string]bool +} +func (options CreateRestorationOptions) New() *CreateRestorationOptions { + options.enabledSetters = map[string]bool{ + "NewResourceId": false, + "NewResourceName": false, + } + return &options +} +type CreateRestorationOption func(*CreateRestorationOptions) +func (srv *Backups) WithCreateRestorationNewResourceId(v string) CreateRestorationOption { + return func(o *CreateRestorationOptions) { + o.NewResourceId = v + o.enabledSetters["NewResourceId"] = true + } +} +func (srv *Backups) WithCreateRestorationNewResourceName(v string) CreateRestorationOption { + return func(o *CreateRestorationOptions) { + o.NewResourceName = v + o.enabledSetters["NewResourceName"] = true + } +} + +// CreateRestoration create and trigger a new restoration for a backup on a +// project. +func (srv *Backups) CreateRestoration(ArchiveId string, Services []string, optionalSetters ...CreateRestorationOption)(*models.BackupRestoration, error) { + path := "/backups/restoration" + options := CreateRestorationOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + params["archiveId"] = ArchiveId + params["services"] = Services + if options.enabledSetters["NewResourceId"] { + params["newResourceId"] = options.NewResourceId + } + if options.enabledSetters["NewResourceName"] { + params["newResourceName"] = options.NewResourceName + } + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("POST", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupRestoration{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupRestoration + parsed, ok := resp.Result.(models.BackupRestoration) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type ListRestorationsOptions struct { + Queries []string + enabledSetters map[string]bool +} +func (options ListRestorationsOptions) New() *ListRestorationsOptions { + options.enabledSetters = map[string]bool{ + "Queries": false, + } + return &options +} +type ListRestorationsOption func(*ListRestorationsOptions) +func (srv *Backups) WithListRestorationsQueries(v []string) ListRestorationsOption { + return func(o *ListRestorationsOptions) { + o.Queries = v + o.enabledSetters["Queries"] = true + } +} + +// ListRestorations list all backup restorations for a project. +func (srv *Backups) ListRestorations(optionalSetters ...ListRestorationsOption)(*models.BackupRestorationList, error) { + path := "/backups/restorations" + options := ListRestorationsOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Queries"] { + params["queries"] = options.Queries + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupRestorationList{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupRestorationList + parsed, ok := resp.Result.(models.BackupRestorationList) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// GetRestoration get the current status of a backup restoration. +func (srv *Backups) GetRestoration(RestorationId string)(*models.BackupRestoration, error) { + r := strings.NewReplacer("{restorationId}", RestorationId) + path := r.Replace("/backups/restorations/{restorationId}") + params := map[string]interface{}{} + params["restorationId"] = RestorationId + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.BackupRestoration{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.BackupRestoration + parsed, ok := resp.Result.(models.BackupRestoration) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} diff --git a/client/client.go b/client/client.go index a17af298..51e298d5 100644 --- a/client/client.go +++ b/client/client.go @@ -74,11 +74,11 @@ type Client struct { func New(optionalSetters ...ClientOption) Client { headers := map[string]string{ "X-Appwrite-Response-Format" : "1.8.0", - "user-agent" : fmt.Sprintf("AppwriteGoSDK/v0.16.0 (%s; %s)", runtime.GOOS, runtime.GOARCH), + "user-agent" : fmt.Sprintf("AppwriteGoSDK/v0.16.1 (%s; %s)", runtime.GOOS, runtime.GOARCH), "x-sdk-name": "Go", "x-sdk-platform": "server", "x-sdk-language": "go", - "x-sdk-version": "v0.16.0", + "x-sdk-version": "v0.16.1", } httpClient, err := GetDefaultClient(defaultTimeout) if err != nil { diff --git a/docs/examples/account/create-anonymous-session.md b/docs/examples/account/create-anonymous-session.md index b6da8a74..1185d1f4 100644 --- a/docs/examples/account/create-anonymous-session.md +++ b/docs/examples/account/create-anonymous-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.CreateAnonymousSession()) +``` diff --git a/docs/examples/account/create-email-password-session.md b/docs/examples/account/create-email-password-session.md index 7067b8a0..c27436bb 100644 --- a/docs/examples/account/create-email-password-session.md +++ b/docs/examples/account/create-email-password-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.CreateEmailPasswordSession( "email@example.com", "password", ) +``` diff --git a/docs/examples/account/create-email-token.md b/docs/examples/account/create-email-token.md index 466d1c83..4746b0c1 100644 --- a/docs/examples/account/create-email-token.md +++ b/docs/examples/account/create-email-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateEmailToken( "email@example.com", account.WithCreateEmailTokenPhrase(false), ) +``` diff --git a/docs/examples/account/create-email-verification.md b/docs/examples/account/create-email-verification.md index d10b88e2..c9483c30 100644 --- a/docs/examples/account/create-email-verification.md +++ b/docs/examples/account/create-email-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.CreateEmailVerification( "https://example.com", ) +``` diff --git a/docs/examples/account/create-jwt.md b/docs/examples/account/create-jwt.md index a5952d8c..70113e58 100644 --- a/docs/examples/account/create-jwt.md +++ b/docs/examples/account/create-jwt.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.CreateJWT( account.WithCreateJWTDuration(0), ) +``` diff --git a/docs/examples/account/create-key.md b/docs/examples/account/create-key.md new file mode 100644 index 00000000..8281f765 --- /dev/null +++ b/docs/examples/account/create-key.md @@ -0,0 +1,22 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.CreateKey( + "", + []interface{}{}, + account.WithCreateKeyExpire(""), +) +``` diff --git a/docs/examples/account/create-magic-url-token.md b/docs/examples/account/create-magic-url-token.md index e1fe8897..a0c4792a 100644 --- a/docs/examples/account/create-magic-url-token.md +++ b/docs/examples/account/create-magic-url-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateMagicURLToken( account.WithCreateMagicURLTokenUrl("https://example.com"), account.WithCreateMagicURLTokenPhrase(false), ) +``` diff --git a/docs/examples/account/create-mfa-authenticator.md b/docs/examples/account/create-mfa-authenticator.md index c0124d6c..f562bb50 100644 --- a/docs/examples/account/create-mfa-authenticator.md +++ b/docs/examples/account/create-mfa-authenticator.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.CreateMFAAuthenticator( "totp", ) +``` diff --git a/docs/examples/account/create-mfa-challenge.md b/docs/examples/account/create-mfa-challenge.md index 7eb816c8..a548edda 100644 --- a/docs/examples/account/create-mfa-challenge.md +++ b/docs/examples/account/create-mfa-challenge.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.CreateMFAChallenge( "email", ) +``` diff --git a/docs/examples/account/create-mfa-recovery-codes.md b/docs/examples/account/create-mfa-recovery-codes.md index 332102ea..d63daefa 100644 --- a/docs/examples/account/create-mfa-recovery-codes.md +++ b/docs/examples/account/create-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.CreateMFARecoveryCodes()) +``` diff --git a/docs/examples/account/create-o-auth-2-token.md b/docs/examples/account/create-o-auth-2-token.md index 48ff13ee..a8519f61 100644 --- a/docs/examples/account/create-o-auth-2-token.md +++ b/docs/examples/account/create-o-auth-2-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateOAuth2Token( account.WithCreateOAuth2TokenFailure("https://example.com"), account.WithCreateOAuth2TokenScopes([]interface{}{}), ) +``` diff --git a/docs/examples/account/create-phone-token.md b/docs/examples/account/create-phone-token.md index 043ef3c8..f47be6e4 100644 --- a/docs/examples/account/create-phone-token.md +++ b/docs/examples/account/create-phone-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.CreatePhoneToken( "", "+12065550100", ) +``` diff --git a/docs/examples/account/create-phone-verification.md b/docs/examples/account/create-phone-verification.md index 68fd7f78..2646633b 100644 --- a/docs/examples/account/create-phone-verification.md +++ b/docs/examples/account/create-phone-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.CreatePhoneVerification()) +``` diff --git a/docs/examples/account/create-recovery.md b/docs/examples/account/create-recovery.md index 5e78d019..36080d0d 100644 --- a/docs/examples/account/create-recovery.md +++ b/docs/examples/account/create-recovery.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.CreateRecovery( "email@example.com", "https://example.com", ) +``` diff --git a/docs/examples/account/create-session.md b/docs/examples/account/create-session.md index 3c24783b..8b3b2ffb 100644 --- a/docs/examples/account/create-session.md +++ b/docs/examples/account/create-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.CreateSession( "", "", ) +``` diff --git a/docs/examples/account/create-verification.md b/docs/examples/account/create-verification.md index 14a1b946..ee2378c5 100644 --- a/docs/examples/account/create-verification.md +++ b/docs/examples/account/create-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.CreateVerification( "https://example.com", ) +``` diff --git a/docs/examples/account/create.md b/docs/examples/account/create.md index ebb50015..6921daf3 100644 --- a/docs/examples/account/create.md +++ b/docs/examples/account/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.Create( "", account.WithCreateName(""), ) +``` diff --git a/docs/examples/account/delete-identity.md b/docs/examples/account/delete-identity.md index a513991a..0a8fa0b7 100644 --- a/docs/examples/account/delete-identity.md +++ b/docs/examples/account/delete-identity.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.DeleteIdentity( "", ) +``` diff --git a/docs/examples/account/delete-key.md b/docs/examples/account/delete-key.md new file mode 100644 index 00000000..fba8de7f --- /dev/null +++ b/docs/examples/account/delete-key.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.DeleteKey( + "", +) +``` diff --git a/docs/examples/account/delete-mfa-authenticator.md b/docs/examples/account/delete-mfa-authenticator.md index 33b7e51a..15dab4ff 100644 --- a/docs/examples/account/delete-mfa-authenticator.md +++ b/docs/examples/account/delete-mfa-authenticator.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.DeleteMFAAuthenticator( "totp", ) +``` diff --git a/docs/examples/account/delete-session.md b/docs/examples/account/delete-session.md index 0a7bb5a8..020582f6 100644 --- a/docs/examples/account/delete-session.md +++ b/docs/examples/account/delete-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.DeleteSession( "", ) +``` diff --git a/docs/examples/account/delete-sessions.md b/docs/examples/account/delete-sessions.md index 87c9881e..43c6f129 100644 --- a/docs/examples/account/delete-sessions.md +++ b/docs/examples/account/delete-sessions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.DeleteSessions()) +``` diff --git a/docs/examples/account/get-key.md b/docs/examples/account/get-key.md new file mode 100644 index 00000000..a04c5aad --- /dev/null +++ b/docs/examples/account/get-key.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.GetKey( + "", +) +``` diff --git a/docs/examples/account/get-mfa-recovery-codes.md b/docs/examples/account/get-mfa-recovery-codes.md index ee955116..01c41e7c 100644 --- a/docs/examples/account/get-mfa-recovery-codes.md +++ b/docs/examples/account/get-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.GetMFARecoveryCodes()) +``` diff --git a/docs/examples/account/get-prefs.md b/docs/examples/account/get-prefs.md index c4511438..c8d530b8 100644 --- a/docs/examples/account/get-prefs.md +++ b/docs/examples/account/get-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.GetPrefs()) +``` diff --git a/docs/examples/account/get-session.md b/docs/examples/account/get-session.md index 9005de9c..12c020d9 100644 --- a/docs/examples/account/get-session.md +++ b/docs/examples/account/get-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.GetSession( "", ) +``` diff --git a/docs/examples/account/get.md b/docs/examples/account/get.md index 280492c7..f2e19d05 100644 --- a/docs/examples/account/get.md +++ b/docs/examples/account/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.Get()) +``` diff --git a/docs/examples/account/list-identities.md b/docs/examples/account/list-identities.md index 30a367e6..b1a178c9 100644 --- a/docs/examples/account/list-identities.md +++ b/docs/examples/account/list-identities.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.ListIdentities( account.WithListIdentitiesQueries([]interface{}{}), account.WithListIdentitiesTotal(false), ) +``` diff --git a/docs/examples/account/list-keys.md b/docs/examples/account/list-keys.md new file mode 100644 index 00000000..3a4c852d --- /dev/null +++ b/docs/examples/account/list-keys.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.ListKeys( + account.WithListKeysTotal(false), +) +``` diff --git a/docs/examples/account/list-logs.md b/docs/examples/account/list-logs.md index f2173181..9ed5884a 100644 --- a/docs/examples/account/list-logs.md +++ b/docs/examples/account/list-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.ListLogs( account.WithListLogsQueries([]interface{}{}), account.WithListLogsTotal(false), ) +``` diff --git a/docs/examples/account/list-mfa-factors.md b/docs/examples/account/list-mfa-factors.md index f6f90f62..1431389f 100644 --- a/docs/examples/account/list-mfa-factors.md +++ b/docs/examples/account/list-mfa-factors.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.ListMFAFactors()) +``` diff --git a/docs/examples/account/list-sessions.md b/docs/examples/account/list-sessions.md index c8a40858..593524c0 100644 --- a/docs/examples/account/list-sessions.md +++ b/docs/examples/account/list-sessions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.ListSessions()) +``` diff --git a/docs/examples/account/update-email-verification.md b/docs/examples/account/update-email-verification.md index 780405d5..b554bbaa 100644 --- a/docs/examples/account/update-email-verification.md +++ b/docs/examples/account/update-email-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateEmailVerification( "", "", ) +``` diff --git a/docs/examples/account/update-email.md b/docs/examples/account/update-email.md index 6defd009..81debd51 100644 --- a/docs/examples/account/update-email.md +++ b/docs/examples/account/update-email.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateEmail( "email@example.com", "password", ) +``` diff --git a/docs/examples/account/update-key.md b/docs/examples/account/update-key.md new file mode 100644 index 00000000..ad64aab0 --- /dev/null +++ b/docs/examples/account/update-key.md @@ -0,0 +1,23 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/account" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := account.New(client) + +response, error := service.UpdateKey( + "", + "", + []interface{}{}, + account.WithUpdateKeyExpire(""), +) +``` diff --git a/docs/examples/account/update-magic-url-session.md b/docs/examples/account/update-magic-url-session.md index 0fc951b3..8d7e192b 100644 --- a/docs/examples/account/update-magic-url-session.md +++ b/docs/examples/account/update-magic-url-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateMagicURLSession( "", "", ) +``` diff --git a/docs/examples/account/update-mfa-authenticator.md b/docs/examples/account/update-mfa-authenticator.md index 49990345..48c1203b 100644 --- a/docs/examples/account/update-mfa-authenticator.md +++ b/docs/examples/account/update-mfa-authenticator.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateMFAAuthenticator( "totp", "", ) +``` diff --git a/docs/examples/account/update-mfa-challenge.md b/docs/examples/account/update-mfa-challenge.md index a9dd94ea..78e6bdff 100644 --- a/docs/examples/account/update-mfa-challenge.md +++ b/docs/examples/account/update-mfa-challenge.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateMFAChallenge( "", "", ) +``` diff --git a/docs/examples/account/update-mfa-recovery-codes.md b/docs/examples/account/update-mfa-recovery-codes.md index fc47d3b0..7b81371d 100644 --- a/docs/examples/account/update-mfa-recovery-codes.md +++ b/docs/examples/account/update-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.UpdateMFARecoveryCodes()) +``` diff --git a/docs/examples/account/update-mfa.md b/docs/examples/account/update-mfa.md index 1808eed8..0ece4de6 100644 --- a/docs/examples/account/update-mfa.md +++ b/docs/examples/account/update-mfa.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.UpdateMFA( false, ) +``` diff --git a/docs/examples/account/update-name.md b/docs/examples/account/update-name.md index 1cf5aa2a..d22d0887 100644 --- a/docs/examples/account/update-name.md +++ b/docs/examples/account/update-name.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.UpdateName( "", ) +``` diff --git a/docs/examples/account/update-password.md b/docs/examples/account/update-password.md index f5746792..df55436d 100644 --- a/docs/examples/account/update-password.md +++ b/docs/examples/account/update-password.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePassword( "", account.WithUpdatePasswordOldPassword("password"), ) +``` diff --git a/docs/examples/account/update-phone-session.md b/docs/examples/account/update-phone-session.md index 6c7ee57b..3490a8b7 100644 --- a/docs/examples/account/update-phone-session.md +++ b/docs/examples/account/update-phone-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePhoneSession( "", "", ) +``` diff --git a/docs/examples/account/update-phone-verification.md b/docs/examples/account/update-phone-verification.md index cb5a9393..811d787c 100644 --- a/docs/examples/account/update-phone-verification.md +++ b/docs/examples/account/update-phone-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePhoneVerification( "", "", ) +``` diff --git a/docs/examples/account/update-phone.md b/docs/examples/account/update-phone.md index ac21bd32..20a9295d 100644 --- a/docs/examples/account/update-phone.md +++ b/docs/examples/account/update-phone.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePhone( "+12065550100", "password", ) +``` diff --git a/docs/examples/account/update-prefs.md b/docs/examples/account/update-prefs.md index 2091395f..d457f3fa 100644 --- a/docs/examples/account/update-prefs.md +++ b/docs/examples/account/update-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdatePrefs( "darkTheme": true }, ) +``` diff --git a/docs/examples/account/update-recovery.md b/docs/examples/account/update-recovery.md index e21e5ccf..4a087191 100644 --- a/docs/examples/account/update-recovery.md +++ b/docs/examples/account/update-recovery.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.UpdateRecovery( "", "", ) +``` diff --git a/docs/examples/account/update-session.md b/docs/examples/account/update-session.md index 4984b9ef..b45210e6 100644 --- a/docs/examples/account/update-session.md +++ b/docs/examples/account/update-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := account.New(client) response, error := service.UpdateSession( "", ) +``` diff --git a/docs/examples/account/update-status.md b/docs/examples/account/update-status.md index e3c5d66a..81073397 100644 --- a/docs/examples/account/update-status.md +++ b/docs/examples/account/update-status.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := account.New(client) response, error := service.UpdateStatus()) +``` diff --git a/docs/examples/account/update-verification.md b/docs/examples/account/update-verification.md index b3175174..74039aef 100644 --- a/docs/examples/account/update-verification.md +++ b/docs/examples/account/update-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateVerification( "", "", ) +``` diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 6b238c9f..5d4142e1 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.GetBrowser( avatars.WithGetBrowserHeight(0), avatars.WithGetBrowserQuality(-1), ) +``` diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 4ca6feb2..62a7bdd4 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.GetCreditCard( avatars.WithGetCreditCardHeight(0), avatars.WithGetCreditCardQuality(-1), ) +``` diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index dafc8dd7..492c99d7 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := avatars.New(client) response, error := service.GetFavicon( "https://example.com", ) +``` diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index ad46317c..2be156a0 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.GetFlag( avatars.WithGetFlagHeight(0), avatars.WithGetFlagQuality(-1), ) +``` diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index 7e9a20f2..723a0cea 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetImage( avatars.WithGetImageWidth(0), avatars.WithGetImageHeight(0), ) +``` diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 84ddfc08..5f320237 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.GetInitials( avatars.WithGetInitialsHeight(0), avatars.WithGetInitialsBackground(""), ) +``` diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index 97efa740..e4557753 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.GetQR( avatars.WithGetQRMargin(0), avatars.WithGetQRDownload(false), ) +``` diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index b0853466..af0f2c49 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -39,3 +39,4 @@ response, error := service.GetScreenshot( avatars.WithGetScreenshotQuality(85), avatars.WithGetScreenshotOutput("jpeg"), ) +``` diff --git a/docs/examples/backups/create-archive.md b/docs/examples/backups/create-archive.md new file mode 100644 index 00000000..6bc81e68 --- /dev/null +++ b/docs/examples/backups/create-archive.md @@ -0,0 +1,21 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.CreateArchive( + []interface{}{}, + backups.WithCreateArchiveResourceId(""), +) +``` diff --git a/docs/examples/backups/create-policy.md b/docs/examples/backups/create-policy.md new file mode 100644 index 00000000..7406f94e --- /dev/null +++ b/docs/examples/backups/create-policy.md @@ -0,0 +1,26 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.CreatePolicy( + "", + []interface{}{}, + 1, + "", + backups.WithCreatePolicyName(""), + backups.WithCreatePolicyResourceId(""), + backups.WithCreatePolicyEnabled(false), +) +``` diff --git a/docs/examples/backups/create-restoration.md b/docs/examples/backups/create-restoration.md new file mode 100644 index 00000000..b85ab52d --- /dev/null +++ b/docs/examples/backups/create-restoration.md @@ -0,0 +1,23 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.CreateRestoration( + "", + []interface{}{}, + backups.WithCreateRestorationNewResourceId(""), + backups.WithCreateRestorationNewResourceName(""), +) +``` diff --git a/docs/examples/backups/delete-archive.md b/docs/examples/backups/delete-archive.md new file mode 100644 index 00000000..550cc2a6 --- /dev/null +++ b/docs/examples/backups/delete-archive.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.DeleteArchive( + "", +) +``` diff --git a/docs/examples/backups/delete-policy.md b/docs/examples/backups/delete-policy.md new file mode 100644 index 00000000..7d77b9b6 --- /dev/null +++ b/docs/examples/backups/delete-policy.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.DeletePolicy( + "", +) +``` diff --git a/docs/examples/backups/get-archive.md b/docs/examples/backups/get-archive.md new file mode 100644 index 00000000..35c425b0 --- /dev/null +++ b/docs/examples/backups/get-archive.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.GetArchive( + "", +) +``` diff --git a/docs/examples/backups/get-policy.md b/docs/examples/backups/get-policy.md new file mode 100644 index 00000000..04c15799 --- /dev/null +++ b/docs/examples/backups/get-policy.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.GetPolicy( + "", +) +``` diff --git a/docs/examples/backups/get-restoration.md b/docs/examples/backups/get-restoration.md new file mode 100644 index 00000000..33d22e70 --- /dev/null +++ b/docs/examples/backups/get-restoration.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.GetRestoration( + "", +) +``` diff --git a/docs/examples/backups/list-archives.md b/docs/examples/backups/list-archives.md new file mode 100644 index 00000000..f10d218f --- /dev/null +++ b/docs/examples/backups/list-archives.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.ListArchives( + backups.WithListArchivesQueries([]interface{}{}), +) +``` diff --git a/docs/examples/backups/list-policies.md b/docs/examples/backups/list-policies.md new file mode 100644 index 00000000..cfb27abc --- /dev/null +++ b/docs/examples/backups/list-policies.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.ListPolicies( + backups.WithListPoliciesQueries([]interface{}{}), +) +``` diff --git a/docs/examples/backups/list-restorations.md b/docs/examples/backups/list-restorations.md new file mode 100644 index 00000000..ff7b7566 --- /dev/null +++ b/docs/examples/backups/list-restorations.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.ListRestorations( + backups.WithListRestorationsQueries([]interface{}{}), +) +``` diff --git a/docs/examples/backups/update-policy.md b/docs/examples/backups/update-policy.md new file mode 100644 index 00000000..2619b7ca --- /dev/null +++ b/docs/examples/backups/update-policy.md @@ -0,0 +1,24 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/backups" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := backups.New(client) + +response, error := service.UpdatePolicy( + "", + backups.WithUpdatePolicyName(""), + backups.WithUpdatePolicyRetention(1), + backups.WithUpdatePolicySchedule(""), + backups.WithUpdatePolicyEnabled(false), +) +``` diff --git a/docs/examples/databases/create-boolean-attribute.md b/docs/examples/databases/create-boolean-attribute.md index db87ed2d..65398b50 100644 --- a/docs/examples/databases/create-boolean-attribute.md +++ b/docs/examples/databases/create-boolean-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateBooleanAttribute( databases.WithCreateBooleanAttributeDefault(false), databases.WithCreateBooleanAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-collection.md b/docs/examples/databases/create-collection.md index 5cad00a6..9cd6c978 100644 --- a/docs/examples/databases/create-collection.md +++ b/docs/examples/databases/create-collection.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateCollection( databases.WithCreateCollectionAttributes([]interface{}{}), databases.WithCreateCollectionIndexes([]interface{}{}), ) +``` diff --git a/docs/examples/databases/create-datetime-attribute.md b/docs/examples/databases/create-datetime-attribute.md index d1b5785b..ea8eb528 100644 --- a/docs/examples/databases/create-datetime-attribute.md +++ b/docs/examples/databases/create-datetime-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateDatetimeAttribute( databases.WithCreateDatetimeAttributeDefault(""), databases.WithCreateDatetimeAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-document.md b/docs/examples/databases/create-document.md index 1c7a4891..1e19aa21 100644 --- a/docs/examples/databases/create-document.md +++ b/docs/examples/databases/create-document.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.CreateDocument( databases.WithCreateDocumentPermissions(interface{}{"read("any")"}), databases.WithCreateDocumentTransactionId(""), ) +``` diff --git a/docs/examples/databases/create-documents.md b/docs/examples/databases/create-documents.md index ae08b2e7..c5993916 100644 --- a/docs/examples/databases/create-documents.md +++ b/docs/examples/databases/create-documents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateDocuments( []interface{}{}, databases.WithCreateDocumentsTransactionId(""), ) +``` diff --git a/docs/examples/databases/create-email-attribute.md b/docs/examples/databases/create-email-attribute.md index 24ceeab4..300f590f 100644 --- a/docs/examples/databases/create-email-attribute.md +++ b/docs/examples/databases/create-email-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateEmailAttribute( databases.WithCreateEmailAttributeDefault("email@example.com"), databases.WithCreateEmailAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-enum-attribute.md b/docs/examples/databases/create-enum-attribute.md index 49c576a6..95783a13 100644 --- a/docs/examples/databases/create-enum-attribute.md +++ b/docs/examples/databases/create-enum-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateEnumAttribute( databases.WithCreateEnumAttributeDefault(""), databases.WithCreateEnumAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-float-attribute.md b/docs/examples/databases/create-float-attribute.md index 2a039e80..c638236b 100644 --- a/docs/examples/databases/create-float-attribute.md +++ b/docs/examples/databases/create-float-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateFloatAttribute( databases.WithCreateFloatAttributeDefault(0), databases.WithCreateFloatAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-index.md b/docs/examples/databases/create-index.md index e2b11982..2cf2c7b3 100644 --- a/docs/examples/databases/create-index.md +++ b/docs/examples/databases/create-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateIndex( databases.WithCreateIndexOrders([]interface{}{}), databases.WithCreateIndexLengths([]interface{}{}), ) +``` diff --git a/docs/examples/databases/create-integer-attribute.md b/docs/examples/databases/create-integer-attribute.md index ad93ff05..3c90b5c3 100644 --- a/docs/examples/databases/create-integer-attribute.md +++ b/docs/examples/databases/create-integer-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateIntegerAttribute( databases.WithCreateIntegerAttributeDefault(0), databases.WithCreateIntegerAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-ip-attribute.md b/docs/examples/databases/create-ip-attribute.md index 47df16ce..62ff98e6 100644 --- a/docs/examples/databases/create-ip-attribute.md +++ b/docs/examples/databases/create-ip-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateIpAttribute( databases.WithCreateIpAttributeDefault(""), databases.WithCreateIpAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-line-attribute.md b/docs/examples/databases/create-line-attribute.md index 49931764..960e3274 100644 --- a/docs/examples/databases/create-line-attribute.md +++ b/docs/examples/databases/create-line-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreateLineAttribute( false, databases.WithCreateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), ) +``` diff --git a/docs/examples/databases/create-longtext-attribute.md b/docs/examples/databases/create-longtext-attribute.md index 630412d0..4e3e2274 100644 --- a/docs/examples/databases/create-longtext-attribute.md +++ b/docs/examples/databases/create-longtext-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateLongtextAttribute( databases.WithCreateLongtextAttributeDefault(""), databases.WithCreateLongtextAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-mediumtext-attribute.md b/docs/examples/databases/create-mediumtext-attribute.md index 0b6c21bc..fc31a2f3 100644 --- a/docs/examples/databases/create-mediumtext-attribute.md +++ b/docs/examples/databases/create-mediumtext-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateMediumtextAttribute( databases.WithCreateMediumtextAttributeDefault(""), databases.WithCreateMediumtextAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-operations.md b/docs/examples/databases/create-operations.md index c73ad577..a11a9b39 100644 --- a/docs/examples/databases/create-operations.md +++ b/docs/examples/databases/create-operations.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.CreateOperations( } }), ) +``` diff --git a/docs/examples/databases/create-point-attribute.md b/docs/examples/databases/create-point-attribute.md index 75d5e790..223b80ef 100644 --- a/docs/examples/databases/create-point-attribute.md +++ b/docs/examples/databases/create-point-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreatePointAttribute( false, databases.WithCreatePointAttributeDefault(interface{}{1, 2}), ) +``` diff --git a/docs/examples/databases/create-polygon-attribute.md b/docs/examples/databases/create-polygon-attribute.md index 0f89b423..9b3aeea9 100644 --- a/docs/examples/databases/create-polygon-attribute.md +++ b/docs/examples/databases/create-polygon-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreatePolygonAttribute( false, databases.WithCreatePolygonAttributeDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), ) +``` diff --git a/docs/examples/databases/create-relationship-attribute.md b/docs/examples/databases/create-relationship-attribute.md index f63779ff..90dfcf79 100644 --- a/docs/examples/databases/create-relationship-attribute.md +++ b/docs/examples/databases/create-relationship-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateRelationshipAttribute( databases.WithCreateRelationshipAttributeTwoWayKey(""), databases.WithCreateRelationshipAttributeOnDelete("cascade"), ) +``` diff --git a/docs/examples/databases/create-string-attribute.md b/docs/examples/databases/create-string-attribute.md index 4082041a..243b7bd5 100644 --- a/docs/examples/databases/create-string-attribute.md +++ b/docs/examples/databases/create-string-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateStringAttribute( databases.WithCreateStringAttributeArray(false), databases.WithCreateStringAttributeEncrypt(false), ) +``` diff --git a/docs/examples/databases/create-text-attribute.md b/docs/examples/databases/create-text-attribute.md index 40bde804..86347766 100644 --- a/docs/examples/databases/create-text-attribute.md +++ b/docs/examples/databases/create-text-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTextAttribute( databases.WithCreateTextAttributeDefault(""), databases.WithCreateTextAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-transaction.md b/docs/examples/databases/create-transaction.md index f74b9152..48df66e8 100644 --- a/docs/examples/databases/create-transaction.md +++ b/docs/examples/databases/create-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.CreateTransaction( databases.WithCreateTransactionTtl(60), ) +``` diff --git a/docs/examples/databases/create-url-attribute.md b/docs/examples/databases/create-url-attribute.md index 5b367e0c..2fb2c084 100644 --- a/docs/examples/databases/create-url-attribute.md +++ b/docs/examples/databases/create-url-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateUrlAttribute( databases.WithCreateUrlAttributeDefault("https://example.com"), databases.WithCreateUrlAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create-varchar-attribute.md b/docs/examples/databases/create-varchar-attribute.md index 53a80990..b4ebbdfd 100644 --- a/docs/examples/databases/create-varchar-attribute.md +++ b/docs/examples/databases/create-varchar-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateVarcharAttribute( databases.WithCreateVarcharAttributeDefault(""), databases.WithCreateVarcharAttributeArray(false), ) +``` diff --git a/docs/examples/databases/create.md b/docs/examples/databases/create.md index 57c8e106..e360cc9d 100644 --- a/docs/examples/databases/create.md +++ b/docs/examples/databases/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.Create( "", databases.WithCreateEnabled(false), ) +``` diff --git a/docs/examples/databases/decrement-document-attribute.md b/docs/examples/databases/decrement-document-attribute.md index 7cb2c1c3..dab7393a 100644 --- a/docs/examples/databases/decrement-document-attribute.md +++ b/docs/examples/databases/decrement-document-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.DecrementDocumentAttribute( databases.WithDecrementDocumentAttributeMin(0), databases.WithDecrementDocumentAttributeTransactionId(""), ) +``` diff --git a/docs/examples/databases/delete-attribute.md b/docs/examples/databases/delete-attribute.md index 96409832..16cf2d97 100644 --- a/docs/examples/databases/delete-attribute.md +++ b/docs/examples/databases/delete-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.DeleteAttribute( "", "", ) +``` diff --git a/docs/examples/databases/delete-collection.md b/docs/examples/databases/delete-collection.md index df303164..651568ad 100644 --- a/docs/examples/databases/delete-collection.md +++ b/docs/examples/databases/delete-collection.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteCollection( "", "", ) +``` diff --git a/docs/examples/databases/delete-document.md b/docs/examples/databases/delete-document.md index 80e44b89..ef53243b 100644 --- a/docs/examples/databases/delete-document.md +++ b/docs/examples/databases/delete-document.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.DeleteDocument( "", databases.WithDeleteDocumentTransactionId(""), ) +``` diff --git a/docs/examples/databases/delete-documents.md b/docs/examples/databases/delete-documents.md index 5c070a0d..9dbfacb0 100644 --- a/docs/examples/databases/delete-documents.md +++ b/docs/examples/databases/delete-documents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.DeleteDocuments( databases.WithDeleteDocumentsQueries([]interface{}{}), databases.WithDeleteDocumentsTransactionId(""), ) +``` diff --git a/docs/examples/databases/delete-index.md b/docs/examples/databases/delete-index.md index 229c50ca..f66f0c5d 100644 --- a/docs/examples/databases/delete-index.md +++ b/docs/examples/databases/delete-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.DeleteIndex( "", "", ) +``` diff --git a/docs/examples/databases/delete-transaction.md b/docs/examples/databases/delete-transaction.md index b06f8bf6..29b3874f 100644 --- a/docs/examples/databases/delete-transaction.md +++ b/docs/examples/databases/delete-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.DeleteTransaction( "", ) +``` diff --git a/docs/examples/databases/delete.md b/docs/examples/databases/delete.md index eb7999cc..7e98dd24 100644 --- a/docs/examples/databases/delete.md +++ b/docs/examples/databases/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/databases/get-attribute.md b/docs/examples/databases/get-attribute.md index e1c5d10d..fefe010f 100644 --- a/docs/examples/databases/get-attribute.md +++ b/docs/examples/databases/get-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetAttribute( "", "", ) +``` diff --git a/docs/examples/databases/get-collection.md b/docs/examples/databases/get-collection.md index 2827eec7..c0d0a512 100644 --- a/docs/examples/databases/get-collection.md +++ b/docs/examples/databases/get-collection.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetCollection( "", "", ) +``` diff --git a/docs/examples/databases/get-document.md b/docs/examples/databases/get-document.md index e075084f..e81e98dd 100644 --- a/docs/examples/databases/get-document.md +++ b/docs/examples/databases/get-document.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.GetDocument( databases.WithGetDocumentQueries([]interface{}{}), databases.WithGetDocumentTransactionId(""), ) +``` diff --git a/docs/examples/databases/get-index.md b/docs/examples/databases/get-index.md index 54d57052..05936c47 100644 --- a/docs/examples/databases/get-index.md +++ b/docs/examples/databases/get-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetIndex( "", "", ) +``` diff --git a/docs/examples/databases/get-transaction.md b/docs/examples/databases/get-transaction.md index 4c15d732..a8d0ddc7 100644 --- a/docs/examples/databases/get-transaction.md +++ b/docs/examples/databases/get-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.GetTransaction( "", ) +``` diff --git a/docs/examples/databases/get.md b/docs/examples/databases/get.md index c92506cf..c32db0a1 100644 --- a/docs/examples/databases/get.md +++ b/docs/examples/databases/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/databases/increment-document-attribute.md b/docs/examples/databases/increment-document-attribute.md index 510d6486..58413aab 100644 --- a/docs/examples/databases/increment-document-attribute.md +++ b/docs/examples/databases/increment-document-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.IncrementDocumentAttribute( databases.WithIncrementDocumentAttributeMax(0), databases.WithIncrementDocumentAttributeTransactionId(""), ) +``` diff --git a/docs/examples/databases/list-attributes.md b/docs/examples/databases/list-attributes.md index 27861ed6..85ef9d2d 100644 --- a/docs/examples/databases/list-attributes.md +++ b/docs/examples/databases/list-attributes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListAttributes( databases.WithListAttributesQueries([]interface{}{}), databases.WithListAttributesTotal(false), ) +``` diff --git a/docs/examples/databases/list-collections.md b/docs/examples/databases/list-collections.md index 52f0da90..6272c380 100644 --- a/docs/examples/databases/list-collections.md +++ b/docs/examples/databases/list-collections.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListCollections( databases.WithListCollectionsSearch(""), databases.WithListCollectionsTotal(false), ) +``` diff --git a/docs/examples/databases/list-documents.md b/docs/examples/databases/list-documents.md index d5c0c029..4232df69 100644 --- a/docs/examples/databases/list-documents.md +++ b/docs/examples/databases/list-documents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.ListDocuments( databases.WithListDocumentsTransactionId(""), databases.WithListDocumentsTotal(false), ) +``` diff --git a/docs/examples/databases/list-indexes.md b/docs/examples/databases/list-indexes.md index 9d9bb0b0..1751e9b1 100644 --- a/docs/examples/databases/list-indexes.md +++ b/docs/examples/databases/list-indexes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListIndexes( databases.WithListIndexesQueries([]interface{}{}), databases.WithListIndexesTotal(false), ) +``` diff --git a/docs/examples/databases/list-transactions.md b/docs/examples/databases/list-transactions.md index 662874bb..4ffcf301 100644 --- a/docs/examples/databases/list-transactions.md +++ b/docs/examples/databases/list-transactions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := databases.New(client) response, error := service.ListTransactions( databases.WithListTransactionsQueries([]interface{}{}), ) +``` diff --git a/docs/examples/databases/list.md b/docs/examples/databases/list.md index 9b7d2f76..30d38325 100644 --- a/docs/examples/databases/list.md +++ b/docs/examples/databases/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( databases.WithListSearch(""), databases.WithListTotal(false), ) +``` diff --git a/docs/examples/databases/update-boolean-attribute.md b/docs/examples/databases/update-boolean-attribute.md index bf854b04..6424d2b6 100644 --- a/docs/examples/databases/update-boolean-attribute.md +++ b/docs/examples/databases/update-boolean-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateBooleanAttribute( false, databases.WithUpdateBooleanAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-collection.md b/docs/examples/databases/update-collection.md index 7470d5a1..18de9ff0 100644 --- a/docs/examples/databases/update-collection.md +++ b/docs/examples/databases/update-collection.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateCollection( databases.WithUpdateCollectionDocumentSecurity(false), databases.WithUpdateCollectionEnabled(false), ) +``` diff --git a/docs/examples/databases/update-datetime-attribute.md b/docs/examples/databases/update-datetime-attribute.md index d78d1b87..d8278836 100644 --- a/docs/examples/databases/update-datetime-attribute.md +++ b/docs/examples/databases/update-datetime-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateDatetimeAttribute( "", databases.WithUpdateDatetimeAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-document.md b/docs/examples/databases/update-document.md index 51359e88..2c01ff3b 100644 --- a/docs/examples/databases/update-document.md +++ b/docs/examples/databases/update-document.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.UpdateDocument( databases.WithUpdateDocumentPermissions(interface{}{"read("any")"}), databases.WithUpdateDocumentTransactionId(""), ) +``` diff --git a/docs/examples/databases/update-documents.md b/docs/examples/databases/update-documents.md index 1e1043c6..91752020 100644 --- a/docs/examples/databases/update-documents.md +++ b/docs/examples/databases/update-documents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -27,3 +27,4 @@ response, error := service.UpdateDocuments( databases.WithUpdateDocumentsQueries([]interface{}{}), databases.WithUpdateDocumentsTransactionId(""), ) +``` diff --git a/docs/examples/databases/update-email-attribute.md b/docs/examples/databases/update-email-attribute.md index 728bbd7a..d988c2a7 100644 --- a/docs/examples/databases/update-email-attribute.md +++ b/docs/examples/databases/update-email-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateEmailAttribute( "email@example.com", databases.WithUpdateEmailAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-enum-attribute.md b/docs/examples/databases/update-enum-attribute.md index 86a5ea08..4fcbc692 100644 --- a/docs/examples/databases/update-enum-attribute.md +++ b/docs/examples/databases/update-enum-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateEnumAttribute( "", databases.WithUpdateEnumAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-float-attribute.md b/docs/examples/databases/update-float-attribute.md index 9dd04e77..52d448dd 100644 --- a/docs/examples/databases/update-float-attribute.md +++ b/docs/examples/databases/update-float-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateFloatAttribute( databases.WithUpdateFloatAttributeMax(0), databases.WithUpdateFloatAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-integer-attribute.md b/docs/examples/databases/update-integer-attribute.md index b9d8bf16..d6283781 100644 --- a/docs/examples/databases/update-integer-attribute.md +++ b/docs/examples/databases/update-integer-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateIntegerAttribute( databases.WithUpdateIntegerAttributeMax(0), databases.WithUpdateIntegerAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-ip-attribute.md b/docs/examples/databases/update-ip-attribute.md index fd1cfcc5..83e0e004 100644 --- a/docs/examples/databases/update-ip-attribute.md +++ b/docs/examples/databases/update-ip-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateIpAttribute( "", databases.WithUpdateIpAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-line-attribute.md b/docs/examples/databases/update-line-attribute.md index 20904415..bd6f2731 100644 --- a/docs/examples/databases/update-line-attribute.md +++ b/docs/examples/databases/update-line-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateLineAttribute( databases.WithUpdateLineAttributeDefault(interface{}{[1, 2], [3, 4], [5, 6]}), databases.WithUpdateLineAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-longtext-attribute.md b/docs/examples/databases/update-longtext-attribute.md index c6898226..1cdba64c 100644 --- a/docs/examples/databases/update-longtext-attribute.md +++ b/docs/examples/databases/update-longtext-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateLongtextAttribute( "", databases.WithUpdateLongtextAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-mediumtext-attribute.md b/docs/examples/databases/update-mediumtext-attribute.md index 6519c6ff..f84948cf 100644 --- a/docs/examples/databases/update-mediumtext-attribute.md +++ b/docs/examples/databases/update-mediumtext-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateMediumtextAttribute( "", databases.WithUpdateMediumtextAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-point-attribute.md b/docs/examples/databases/update-point-attribute.md index 735b4d8c..633766d1 100644 --- a/docs/examples/databases/update-point-attribute.md +++ b/docs/examples/databases/update-point-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdatePointAttribute( databases.WithUpdatePointAttributeDefault(interface{}{1, 2}), databases.WithUpdatePointAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-polygon-attribute.md b/docs/examples/databases/update-polygon-attribute.md index 6499f364..d58127e1 100644 --- a/docs/examples/databases/update-polygon-attribute.md +++ b/docs/examples/databases/update-polygon-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdatePolygonAttribute( databases.WithUpdatePolygonAttributeDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), databases.WithUpdatePolygonAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-relationship-attribute.md b/docs/examples/databases/update-relationship-attribute.md index 0c9ee73f..4b150eb3 100644 --- a/docs/examples/databases/update-relationship-attribute.md +++ b/docs/examples/databases/update-relationship-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdateRelationshipAttribute( databases.WithUpdateRelationshipAttributeOnDelete("cascade"), databases.WithUpdateRelationshipAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-string-attribute.md b/docs/examples/databases/update-string-attribute.md index 0d131001..49231f25 100644 --- a/docs/examples/databases/update-string-attribute.md +++ b/docs/examples/databases/update-string-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateStringAttribute( databases.WithUpdateStringAttributeSize(1), databases.WithUpdateStringAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-text-attribute.md b/docs/examples/databases/update-text-attribute.md index ab2148b3..ca33c4f8 100644 --- a/docs/examples/databases/update-text-attribute.md +++ b/docs/examples/databases/update-text-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTextAttribute( "", databases.WithUpdateTextAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-transaction.md b/docs/examples/databases/update-transaction.md index 76ef4acb..bf2cd17a 100644 --- a/docs/examples/databases/update-transaction.md +++ b/docs/examples/databases/update-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.UpdateTransaction( databases.WithUpdateTransactionCommit(false), databases.WithUpdateTransactionRollback(false), ) +``` diff --git a/docs/examples/databases/update-url-attribute.md b/docs/examples/databases/update-url-attribute.md index 56dfbf03..2a8ba816 100644 --- a/docs/examples/databases/update-url-attribute.md +++ b/docs/examples/databases/update-url-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateUrlAttribute( "https://example.com", databases.WithUpdateUrlAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update-varchar-attribute.md b/docs/examples/databases/update-varchar-attribute.md index 18ba57dc..b3de02d6 100644 --- a/docs/examples/databases/update-varchar-attribute.md +++ b/docs/examples/databases/update-varchar-attribute.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateVarcharAttribute( databases.WithUpdateVarcharAttributeSize(1), databases.WithUpdateVarcharAttributeNewKey(""), ) +``` diff --git a/docs/examples/databases/update.md b/docs/examples/databases/update.md index 4aa4a4d7..ad78a890 100644 --- a/docs/examples/databases/update.md +++ b/docs/examples/databases/update.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.Update( databases.WithUpdateName(""), databases.WithUpdateEnabled(false), ) +``` diff --git a/docs/examples/databases/upsert-document.md b/docs/examples/databases/upsert-document.md index 95f1c4b6..7f34ba2b 100644 --- a/docs/examples/databases/upsert-document.md +++ b/docs/examples/databases/upsert-document.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.UpsertDocument( databases.WithUpsertDocumentPermissions(interface{}{"read("any")"}), databases.WithUpsertDocumentTransactionId(""), ) +``` diff --git a/docs/examples/databases/upsert-documents.md b/docs/examples/databases/upsert-documents.md index 9088883b..98f0f0a7 100644 --- a/docs/examples/databases/upsert-documents.md +++ b/docs/examples/databases/upsert-documents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.UpsertDocuments( []interface{}{}, databases.WithUpsertDocumentsTransactionId(""), ) +``` diff --git a/docs/examples/functions/create-deployment.md b/docs/examples/functions/create-deployment.md index 86eda6f0..55ce0cef 100644 --- a/docs/examples/functions/create-deployment.md +++ b/docs/examples/functions/create-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreateDeployment( functions.WithCreateDeploymentEntrypoint(""), functions.WithCreateDeploymentCommands(""), ) +``` diff --git a/docs/examples/functions/create-duplicate-deployment.md b/docs/examples/functions/create-duplicate-deployment.md index 8c01a9e3..02569d30 100644 --- a/docs/examples/functions/create-duplicate-deployment.md +++ b/docs/examples/functions/create-duplicate-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateDuplicateDeployment( "", functions.WithCreateDuplicateDeploymentBuildId(""), ) +``` diff --git a/docs/examples/functions/create-execution.md b/docs/examples/functions/create-execution.md index 1f723b80..1135295d 100644 --- a/docs/examples/functions/create-execution.md +++ b/docs/examples/functions/create-execution.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateExecution( functions.WithCreateExecutionHeaders(map[string]interface{}{}), functions.WithCreateExecutionScheduledAt(""), ) +``` diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index df9591f4..a6af9582 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateTemplateDeployment( "", functions.WithCreateTemplateDeploymentActivate(false), ) +``` diff --git a/docs/examples/functions/create-variable.md b/docs/examples/functions/create-variable.md index 84b68b83..46e2f706 100644 --- a/docs/examples/functions/create-variable.md +++ b/docs/examples/functions/create-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateVariable( "", functions.WithCreateVariableSecret(false), ) +``` diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index 5ccb0455..15f4ad5b 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateVcsDeployment( "", functions.WithCreateVcsDeploymentActivate(false), ) +``` diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index 5bacf3ce..109a7bb3 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -34,3 +34,4 @@ response, error := service.Create( functions.WithCreateProviderRootDirectory(""), functions.WithCreateSpecification(""), ) +``` diff --git a/docs/examples/functions/delete-deployment.md b/docs/examples/functions/delete-deployment.md index 297c4336..ea8036e1 100644 --- a/docs/examples/functions/delete-deployment.md +++ b/docs/examples/functions/delete-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteDeployment( "", "", ) +``` diff --git a/docs/examples/functions/delete-execution.md b/docs/examples/functions/delete-execution.md index 493488cf..14785b48 100644 --- a/docs/examples/functions/delete-execution.md +++ b/docs/examples/functions/delete-execution.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteExecution( "", "", ) +``` diff --git a/docs/examples/functions/delete-variable.md b/docs/examples/functions/delete-variable.md index 049afed8..5f038ecf 100644 --- a/docs/examples/functions/delete-variable.md +++ b/docs/examples/functions/delete-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteVariable( "", "", ) +``` diff --git a/docs/examples/functions/delete.md b/docs/examples/functions/delete.md index fe2a02d8..5fc7bda9 100644 --- a/docs/examples/functions/delete.md +++ b/docs/examples/functions/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := functions.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index 26f14512..fb389956 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetDeploymentDownload( "", functions.WithGetDeploymentDownloadType("source"), ) +``` diff --git a/docs/examples/functions/get-deployment.md b/docs/examples/functions/get-deployment.md index f05bfd73..f4486da1 100644 --- a/docs/examples/functions/get-deployment.md +++ b/docs/examples/functions/get-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetDeployment( "", "", ) +``` diff --git a/docs/examples/functions/get-execution.md b/docs/examples/functions/get-execution.md index 5fa2a32e..6874411d 100644 --- a/docs/examples/functions/get-execution.md +++ b/docs/examples/functions/get-execution.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetExecution( "", "", ) +``` diff --git a/docs/examples/functions/get-variable.md b/docs/examples/functions/get-variable.md index 78916740..42ac0f95 100644 --- a/docs/examples/functions/get-variable.md +++ b/docs/examples/functions/get-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetVariable( "", "", ) +``` diff --git a/docs/examples/functions/get.md b/docs/examples/functions/get.md index 91e21e4e..8b2f5ff6 100644 --- a/docs/examples/functions/get.md +++ b/docs/examples/functions/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := functions.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/functions/list-deployments.md b/docs/examples/functions/list-deployments.md index 57169848..9a7b67ef 100644 --- a/docs/examples/functions/list-deployments.md +++ b/docs/examples/functions/list-deployments.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListDeployments( functions.WithListDeploymentsSearch(""), functions.WithListDeploymentsTotal(false), ) +``` diff --git a/docs/examples/functions/list-executions.md b/docs/examples/functions/list-executions.md index 498d103e..26c945f3 100644 --- a/docs/examples/functions/list-executions.md +++ b/docs/examples/functions/list-executions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListExecutions( functions.WithListExecutionsQueries([]interface{}{}), functions.WithListExecutionsTotal(false), ) +``` diff --git a/docs/examples/functions/list-runtimes.md b/docs/examples/functions/list-runtimes.md index c40a08f1..6886aac0 100644 --- a/docs/examples/functions/list-runtimes.md +++ b/docs/examples/functions/list-runtimes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := functions.New(client) response, error := service.ListRuntimes()) +``` diff --git a/docs/examples/functions/list-specifications.md b/docs/examples/functions/list-specifications.md index c0a29fc3..9f3625b8 100644 --- a/docs/examples/functions/list-specifications.md +++ b/docs/examples/functions/list-specifications.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := functions.New(client) response, error := service.ListSpecifications()) +``` diff --git a/docs/examples/functions/list-variables.md b/docs/examples/functions/list-variables.md index e71f0170..97acd3be 100644 --- a/docs/examples/functions/list-variables.md +++ b/docs/examples/functions/list-variables.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := functions.New(client) response, error := service.ListVariables( "", ) +``` diff --git a/docs/examples/functions/list.md b/docs/examples/functions/list.md index f152c156..8c7ef658 100644 --- a/docs/examples/functions/list.md +++ b/docs/examples/functions/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( functions.WithListSearch(""), functions.WithListTotal(false), ) +``` diff --git a/docs/examples/functions/update-deployment-status.md b/docs/examples/functions/update-deployment-status.md index f29be755..2d1ace6b 100644 --- a/docs/examples/functions/update-deployment-status.md +++ b/docs/examples/functions/update-deployment-status.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateDeploymentStatus( "", "", ) +``` diff --git a/docs/examples/functions/update-function-deployment.md b/docs/examples/functions/update-function-deployment.md index 9e85be96..d733be48 100644 --- a/docs/examples/functions/update-function-deployment.md +++ b/docs/examples/functions/update-function-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateFunctionDeployment( "", "", ) +``` diff --git a/docs/examples/functions/update-variable.md b/docs/examples/functions/update-variable.md index aad017d8..da009f40 100644 --- a/docs/examples/functions/update-variable.md +++ b/docs/examples/functions/update-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdateVariable( functions.WithUpdateVariableValue(""), functions.WithUpdateVariableSecret(false), ) +``` diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index 1e652489..fd3c54da 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -34,3 +34,4 @@ response, error := service.Update( functions.WithUpdateProviderRootDirectory(""), functions.WithUpdateSpecification(""), ) +``` diff --git a/docs/examples/graphql/mutation.md b/docs/examples/graphql/mutation.md index 04d9d58f..81dcfebe 100644 --- a/docs/examples/graphql/mutation.md +++ b/docs/examples/graphql/mutation.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := graphql.New(client) response, error := service.Mutation( map[string]interface{}{}, ) +``` diff --git a/docs/examples/graphql/query.md b/docs/examples/graphql/query.md index 05699ad8..6ac4145f 100644 --- a/docs/examples/graphql/query.md +++ b/docs/examples/graphql/query.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := graphql.New(client) response, error := service.Query( map[string]interface{}{}, ) +``` diff --git a/docs/examples/health/get-antivirus.md b/docs/examples/health/get-antivirus.md index 0d7ffcec..090214a1 100644 --- a/docs/examples/health/get-antivirus.md +++ b/docs/examples/health/get-antivirus.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetAntivirus()) +``` diff --git a/docs/examples/health/get-cache.md b/docs/examples/health/get-cache.md index 1d4dd1aa..77426d19 100644 --- a/docs/examples/health/get-cache.md +++ b/docs/examples/health/get-cache.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetCache()) +``` diff --git a/docs/examples/health/get-certificate.md b/docs/examples/health/get-certificate.md index 3590e97c..510c7e80 100644 --- a/docs/examples/health/get-certificate.md +++ b/docs/examples/health/get-certificate.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetCertificate( health.WithGetCertificateDomain(""), ) +``` diff --git a/docs/examples/health/get-db.md b/docs/examples/health/get-db.md index 293e8666..7fe0c48d 100644 --- a/docs/examples/health/get-db.md +++ b/docs/examples/health/get-db.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetDB()) +``` diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 7dfcc5ed..c4f6094e 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetFailedJobs( "v1-database", health.WithGetFailedJobsThreshold(0), ) +``` diff --git a/docs/examples/health/get-pub-sub.md b/docs/examples/health/get-pub-sub.md index 998de389..f8496f1d 100644 --- a/docs/examples/health/get-pub-sub.md +++ b/docs/examples/health/get-pub-sub.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetPubSub()) +``` diff --git a/docs/examples/health/get-queue-audits.md b/docs/examples/health/get-queue-audits.md index 413a7e6c..4cf6d110 100644 --- a/docs/examples/health/get-queue-audits.md +++ b/docs/examples/health/get-queue-audits.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueAudits( health.WithGetQueueAuditsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-billing-project-aggregation.md b/docs/examples/health/get-queue-billing-project-aggregation.md new file mode 100644 index 00000000..3c5037e9 --- /dev/null +++ b/docs/examples/health/get-queue-billing-project-aggregation.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := health.New(client) + +response, error := service.GetQueueBillingProjectAggregation( + health.WithGetQueueBillingProjectAggregationThreshold(0), +) +``` diff --git a/docs/examples/health/get-queue-billing-team-aggregation.md b/docs/examples/health/get-queue-billing-team-aggregation.md new file mode 100644 index 00000000..ea1fdc50 --- /dev/null +++ b/docs/examples/health/get-queue-billing-team-aggregation.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := health.New(client) + +response, error := service.GetQueueBillingTeamAggregation( + health.WithGetQueueBillingTeamAggregationThreshold(0), +) +``` diff --git a/docs/examples/health/get-queue-builds.md b/docs/examples/health/get-queue-builds.md index 4f41ee57..5d4c52db 100644 --- a/docs/examples/health/get-queue-builds.md +++ b/docs/examples/health/get-queue-builds.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueBuilds( health.WithGetQueueBuildsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-certificates.md b/docs/examples/health/get-queue-certificates.md index 1cb06f49..6cb10c0b 100644 --- a/docs/examples/health/get-queue-certificates.md +++ b/docs/examples/health/get-queue-certificates.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueCertificates( health.WithGetQueueCertificatesThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-databases.md b/docs/examples/health/get-queue-databases.md index 51ad2d8e..0a94e859 100644 --- a/docs/examples/health/get-queue-databases.md +++ b/docs/examples/health/get-queue-databases.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetQueueDatabases( health.WithGetQueueDatabasesName(""), health.WithGetQueueDatabasesThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-deletes.md b/docs/examples/health/get-queue-deletes.md index 97ac4d2a..facce4f5 100644 --- a/docs/examples/health/get-queue-deletes.md +++ b/docs/examples/health/get-queue-deletes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueDeletes( health.WithGetQueueDeletesThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-functions.md b/docs/examples/health/get-queue-functions.md index 56c7517b..18723342 100644 --- a/docs/examples/health/get-queue-functions.md +++ b/docs/examples/health/get-queue-functions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueFunctions( health.WithGetQueueFunctionsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-logs.md b/docs/examples/health/get-queue-logs.md index 76952a31..ad6612c5 100644 --- a/docs/examples/health/get-queue-logs.md +++ b/docs/examples/health/get-queue-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueLogs( health.WithGetQueueLogsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-mails.md b/docs/examples/health/get-queue-mails.md index 3d85dda4..3f774eeb 100644 --- a/docs/examples/health/get-queue-mails.md +++ b/docs/examples/health/get-queue-mails.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueMails( health.WithGetQueueMailsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-messaging.md b/docs/examples/health/get-queue-messaging.md index db8a9034..43fd0870 100644 --- a/docs/examples/health/get-queue-messaging.md +++ b/docs/examples/health/get-queue-messaging.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueMessaging( health.WithGetQueueMessagingThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-migrations.md b/docs/examples/health/get-queue-migrations.md index ae5c5246..988367c2 100644 --- a/docs/examples/health/get-queue-migrations.md +++ b/docs/examples/health/get-queue-migrations.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueMigrations( health.WithGetQueueMigrationsThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-priority-builds.md b/docs/examples/health/get-queue-priority-builds.md new file mode 100644 index 00000000..2e607c88 --- /dev/null +++ b/docs/examples/health/get-queue-priority-builds.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := health.New(client) + +response, error := service.GetQueuePriorityBuilds( + health.WithGetQueuePriorityBuildsThreshold(0), +) +``` diff --git a/docs/examples/health/get-queue-region-manager.md b/docs/examples/health/get-queue-region-manager.md new file mode 100644 index 00000000..ba4c112d --- /dev/null +++ b/docs/examples/health/get-queue-region-manager.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := health.New(client) + +response, error := service.GetQueueRegionManager( + health.WithGetQueueRegionManagerThreshold(0), +) +``` diff --git a/docs/examples/health/get-queue-stats-resources.md b/docs/examples/health/get-queue-stats-resources.md index 28de62a3..c16e6b52 100644 --- a/docs/examples/health/get-queue-stats-resources.md +++ b/docs/examples/health/get-queue-stats-resources.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueStatsResources( health.WithGetQueueStatsResourcesThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-threats.md b/docs/examples/health/get-queue-threats.md new file mode 100644 index 00000000..21533c94 --- /dev/null +++ b/docs/examples/health/get-queue-threats.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/health" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithKey("") +) + +service := health.New(client) + +response, error := service.GetQueueThreats( + health.WithGetQueueThreatsThreshold(0), +) +``` diff --git a/docs/examples/health/get-queue-usage.md b/docs/examples/health/get-queue-usage.md index e081c077..33b673d4 100644 --- a/docs/examples/health/get-queue-usage.md +++ b/docs/examples/health/get-queue-usage.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueUsage( health.WithGetQueueUsageThreshold(0), ) +``` diff --git a/docs/examples/health/get-queue-webhooks.md b/docs/examples/health/get-queue-webhooks.md index 85acb520..769eb1e0 100644 --- a/docs/examples/health/get-queue-webhooks.md +++ b/docs/examples/health/get-queue-webhooks.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := health.New(client) response, error := service.GetQueueWebhooks( health.WithGetQueueWebhooksThreshold(0), ) +``` diff --git a/docs/examples/health/get-storage-local.md b/docs/examples/health/get-storage-local.md index 41b5dfaa..13371ce0 100644 --- a/docs/examples/health/get-storage-local.md +++ b/docs/examples/health/get-storage-local.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetStorageLocal()) +``` diff --git a/docs/examples/health/get-storage.md b/docs/examples/health/get-storage.md index 33ad742e..0f13f869 100644 --- a/docs/examples/health/get-storage.md +++ b/docs/examples/health/get-storage.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetStorage()) +``` diff --git a/docs/examples/health/get-time.md b/docs/examples/health/get-time.md index f995ad9d..0c23cb5a 100644 --- a/docs/examples/health/get-time.md +++ b/docs/examples/health/get-time.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.GetTime()) +``` diff --git a/docs/examples/health/get.md b/docs/examples/health/get.md index da7e86a8..79badcc3 100644 --- a/docs/examples/health/get.md +++ b/docs/examples/health/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := health.New(client) response, error := service.Get()) +``` diff --git a/docs/examples/locale/get.md b/docs/examples/locale/get.md index 87a4513d..53e900d2 100644 --- a/docs/examples/locale/get.md +++ b/docs/examples/locale/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.Get()) +``` diff --git a/docs/examples/locale/list-codes.md b/docs/examples/locale/list-codes.md index b204a13b..52e0fa54 100644 --- a/docs/examples/locale/list-codes.md +++ b/docs/examples/locale/list-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListCodes()) +``` diff --git a/docs/examples/locale/list-continents.md b/docs/examples/locale/list-continents.md index 4db9555f..8e80d4dd 100644 --- a/docs/examples/locale/list-continents.md +++ b/docs/examples/locale/list-continents.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListContinents()) +``` diff --git a/docs/examples/locale/list-countries-eu.md b/docs/examples/locale/list-countries-eu.md index e46c9235..2766d0ad 100644 --- a/docs/examples/locale/list-countries-eu.md +++ b/docs/examples/locale/list-countries-eu.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListCountriesEU()) +``` diff --git a/docs/examples/locale/list-countries-phones.md b/docs/examples/locale/list-countries-phones.md index 301d94db..5e678072 100644 --- a/docs/examples/locale/list-countries-phones.md +++ b/docs/examples/locale/list-countries-phones.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListCountriesPhones()) +``` diff --git a/docs/examples/locale/list-countries.md b/docs/examples/locale/list-countries.md index b598adbb..53d68e9c 100644 --- a/docs/examples/locale/list-countries.md +++ b/docs/examples/locale/list-countries.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListCountries()) +``` diff --git a/docs/examples/locale/list-currencies.md b/docs/examples/locale/list-currencies.md index 50464979..19fa31dd 100644 --- a/docs/examples/locale/list-currencies.md +++ b/docs/examples/locale/list-currencies.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListCurrencies()) +``` diff --git a/docs/examples/locale/list-languages.md b/docs/examples/locale/list-languages.md index 2737401b..2c87f729 100644 --- a/docs/examples/locale/list-languages.md +++ b/docs/examples/locale/list-languages.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := locale.New(client) response, error := service.ListLanguages()) +``` diff --git a/docs/examples/messaging/create-apns-provider.md b/docs/examples/messaging/create-apns-provider.md index ae9a95eb..3d4f560a 100644 --- a/docs/examples/messaging/create-apns-provider.md +++ b/docs/examples/messaging/create-apns-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateAPNSProvider( messaging.WithCreateAPNSProviderSandbox(false), messaging.WithCreateAPNSProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-email.md b/docs/examples/messaging/create-email.md index 2c9a09a3..4132185c 100644 --- a/docs/examples/messaging/create-email.md +++ b/docs/examples/messaging/create-email.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.CreateEmail( messaging.WithCreateEmailHtml(false), messaging.WithCreateEmailScheduledAt(""), ) +``` diff --git a/docs/examples/messaging/create-fcm-provider.md b/docs/examples/messaging/create-fcm-provider.md index dd6733bc..78c61a57 100644 --- a/docs/examples/messaging/create-fcm-provider.md +++ b/docs/examples/messaging/create-fcm-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateFCMProvider( messaging.WithCreateFCMProviderServiceAccountJSON(map[string]interface{}{}), messaging.WithCreateFCMProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-mailgun-provider.md b/docs/examples/messaging/create-mailgun-provider.md index cbeefd4e..c899308f 100644 --- a/docs/examples/messaging/create-mailgun-provider.md +++ b/docs/examples/messaging/create-mailgun-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -26,3 +26,4 @@ response, error := service.CreateMailgunProvider( messaging.WithCreateMailgunProviderReplyToEmail("email@example.com"), messaging.WithCreateMailgunProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-msg-91-provider.md b/docs/examples/messaging/create-msg-91-provider.md index 3cc3f90c..986f6e82 100644 --- a/docs/examples/messaging/create-msg-91-provider.md +++ b/docs/examples/messaging/create-msg-91-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateMsg91Provider( messaging.WithCreateMsg91ProviderAuthKey(""), messaging.WithCreateMsg91ProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-push.md b/docs/examples/messaging/create-push.md index a607f439..f143c53d 100644 --- a/docs/examples/messaging/create-push.md +++ b/docs/examples/messaging/create-push.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -35,3 +35,4 @@ response, error := service.CreatePush( messaging.WithCreatePushCritical(false), messaging.WithCreatePushPriority("normal"), ) +``` diff --git a/docs/examples/messaging/create-resend-provider.md b/docs/examples/messaging/create-resend-provider.md index a8ec0ad3..484b1b84 100644 --- a/docs/examples/messaging/create-resend-provider.md +++ b/docs/examples/messaging/create-resend-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateResendProvider( messaging.WithCreateResendProviderReplyToEmail("email@example.com"), messaging.WithCreateResendProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-sendgrid-provider.md b/docs/examples/messaging/create-sendgrid-provider.md index c2a67877..4a2b1eb6 100644 --- a/docs/examples/messaging/create-sendgrid-provider.md +++ b/docs/examples/messaging/create-sendgrid-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateSendgridProvider( messaging.WithCreateSendgridProviderReplyToEmail("email@example.com"), messaging.WithCreateSendgridProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-sms.md b/docs/examples/messaging/create-sms.md index cb7d62e4..4377bdbd 100644 --- a/docs/examples/messaging/create-sms.md +++ b/docs/examples/messaging/create-sms.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateSMS( messaging.WithCreateSMSDraft(false), messaging.WithCreateSMSScheduledAt(""), ) +``` diff --git a/docs/examples/messaging/create-smtp-provider.md b/docs/examples/messaging/create-smtp-provider.md index c469aa57..3eab9c74 100644 --- a/docs/examples/messaging/create-smtp-provider.md +++ b/docs/examples/messaging/create-smtp-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -30,3 +30,4 @@ response, error := service.CreateSMTPProvider( messaging.WithCreateSMTPProviderReplyToEmail("email@example.com"), messaging.WithCreateSMTPProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-subscriber.md b/docs/examples/messaging/create-subscriber.md index ebc0f6bb..1a7eff5f 100644 --- a/docs/examples/messaging/create-subscriber.md +++ b/docs/examples/messaging/create-subscriber.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateSubscriber( "", "", ) +``` diff --git a/docs/examples/messaging/create-telesign-provider.md b/docs/examples/messaging/create-telesign-provider.md index 4605ad37..b58d69ee 100644 --- a/docs/examples/messaging/create-telesign-provider.md +++ b/docs/examples/messaging/create-telesign-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTelesignProvider( messaging.WithCreateTelesignProviderApiKey(""), messaging.WithCreateTelesignProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-textmagic-provider.md b/docs/examples/messaging/create-textmagic-provider.md index 2101fab6..44c9ad70 100644 --- a/docs/examples/messaging/create-textmagic-provider.md +++ b/docs/examples/messaging/create-textmagic-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTextmagicProvider( messaging.WithCreateTextmagicProviderApiKey(""), messaging.WithCreateTextmagicProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-topic.md b/docs/examples/messaging/create-topic.md index 71814b8d..814d0c60 100644 --- a/docs/examples/messaging/create-topic.md +++ b/docs/examples/messaging/create-topic.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateTopic( "", messaging.WithCreateTopicSubscribe(interface{}{"any"}), ) +``` diff --git a/docs/examples/messaging/create-twilio-provider.md b/docs/examples/messaging/create-twilio-provider.md index 931a2538..44efd6f2 100644 --- a/docs/examples/messaging/create-twilio-provider.md +++ b/docs/examples/messaging/create-twilio-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTwilioProvider( messaging.WithCreateTwilioProviderAuthToken(""), messaging.WithCreateTwilioProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/create-vonage-provider.md b/docs/examples/messaging/create-vonage-provider.md index 6ef35761..6b8b9273 100644 --- a/docs/examples/messaging/create-vonage-provider.md +++ b/docs/examples/messaging/create-vonage-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateVonageProvider( messaging.WithCreateVonageProviderApiSecret(""), messaging.WithCreateVonageProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/delete-provider.md b/docs/examples/messaging/delete-provider.md index f2a07bbb..380af952 100644 --- a/docs/examples/messaging/delete-provider.md +++ b/docs/examples/messaging/delete-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.DeleteProvider( "", ) +``` diff --git a/docs/examples/messaging/delete-subscriber.md b/docs/examples/messaging/delete-subscriber.md index dd8b9889..4c43bd6e 100644 --- a/docs/examples/messaging/delete-subscriber.md +++ b/docs/examples/messaging/delete-subscriber.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteSubscriber( "", "", ) +``` diff --git a/docs/examples/messaging/delete-topic.md b/docs/examples/messaging/delete-topic.md index 7ebf8705..0b7a41ac 100644 --- a/docs/examples/messaging/delete-topic.md +++ b/docs/examples/messaging/delete-topic.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.DeleteTopic( "", ) +``` diff --git a/docs/examples/messaging/delete.md b/docs/examples/messaging/delete.md index f8400c69..ae083ae4 100644 --- a/docs/examples/messaging/delete.md +++ b/docs/examples/messaging/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/messaging/get-message.md b/docs/examples/messaging/get-message.md index ff1b8fa0..1de4e42e 100644 --- a/docs/examples/messaging/get-message.md +++ b/docs/examples/messaging/get-message.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.GetMessage( "", ) +``` diff --git a/docs/examples/messaging/get-provider.md b/docs/examples/messaging/get-provider.md index 34781802..b043da7a 100644 --- a/docs/examples/messaging/get-provider.md +++ b/docs/examples/messaging/get-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.GetProvider( "", ) +``` diff --git a/docs/examples/messaging/get-subscriber.md b/docs/examples/messaging/get-subscriber.md index 7774204c..dd11117a 100644 --- a/docs/examples/messaging/get-subscriber.md +++ b/docs/examples/messaging/get-subscriber.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetSubscriber( "", "", ) +``` diff --git a/docs/examples/messaging/get-topic.md b/docs/examples/messaging/get-topic.md index 2f258be4..5e03fa48 100644 --- a/docs/examples/messaging/get-topic.md +++ b/docs/examples/messaging/get-topic.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := messaging.New(client) response, error := service.GetTopic( "", ) +``` diff --git a/docs/examples/messaging/list-message-logs.md b/docs/examples/messaging/list-message-logs.md index b633f8ae..d74027c0 100644 --- a/docs/examples/messaging/list-message-logs.md +++ b/docs/examples/messaging/list-message-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListMessageLogs( messaging.WithListMessageLogsQueries([]interface{}{}), messaging.WithListMessageLogsTotal(false), ) +``` diff --git a/docs/examples/messaging/list-messages.md b/docs/examples/messaging/list-messages.md index 6eb2284f..cd16ed42 100644 --- a/docs/examples/messaging/list-messages.md +++ b/docs/examples/messaging/list-messages.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListMessages( messaging.WithListMessagesSearch(""), messaging.WithListMessagesTotal(false), ) +``` diff --git a/docs/examples/messaging/list-provider-logs.md b/docs/examples/messaging/list-provider-logs.md index ba42f32d..9df76276 100644 --- a/docs/examples/messaging/list-provider-logs.md +++ b/docs/examples/messaging/list-provider-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListProviderLogs( messaging.WithListProviderLogsQueries([]interface{}{}), messaging.WithListProviderLogsTotal(false), ) +``` diff --git a/docs/examples/messaging/list-providers.md b/docs/examples/messaging/list-providers.md index 27df6f1c..f8cb65a8 100644 --- a/docs/examples/messaging/list-providers.md +++ b/docs/examples/messaging/list-providers.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListProviders( messaging.WithListProvidersSearch(""), messaging.WithListProvidersTotal(false), ) +``` diff --git a/docs/examples/messaging/list-subscriber-logs.md b/docs/examples/messaging/list-subscriber-logs.md index 82aadb5d..101b8e64 100644 --- a/docs/examples/messaging/list-subscriber-logs.md +++ b/docs/examples/messaging/list-subscriber-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListSubscriberLogs( messaging.WithListSubscriberLogsQueries([]interface{}{}), messaging.WithListSubscriberLogsTotal(false), ) +``` diff --git a/docs/examples/messaging/list-subscribers.md b/docs/examples/messaging/list-subscribers.md index fbdb0363..cef28f57 100644 --- a/docs/examples/messaging/list-subscribers.md +++ b/docs/examples/messaging/list-subscribers.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListSubscribers( messaging.WithListSubscribersSearch(""), messaging.WithListSubscribersTotal(false), ) +``` diff --git a/docs/examples/messaging/list-targets.md b/docs/examples/messaging/list-targets.md index c268993b..a6eb01e3 100644 --- a/docs/examples/messaging/list-targets.md +++ b/docs/examples/messaging/list-targets.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListTargets( messaging.WithListTargetsQueries([]interface{}{}), messaging.WithListTargetsTotal(false), ) +``` diff --git a/docs/examples/messaging/list-topic-logs.md b/docs/examples/messaging/list-topic-logs.md index 3777f61f..b5382cf6 100644 --- a/docs/examples/messaging/list-topic-logs.md +++ b/docs/examples/messaging/list-topic-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListTopicLogs( messaging.WithListTopicLogsQueries([]interface{}{}), messaging.WithListTopicLogsTotal(false), ) +``` diff --git a/docs/examples/messaging/list-topics.md b/docs/examples/messaging/list-topics.md index d4198f48..dd0a2675 100644 --- a/docs/examples/messaging/list-topics.md +++ b/docs/examples/messaging/list-topics.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListTopics( messaging.WithListTopicsSearch(""), messaging.WithListTopicsTotal(false), ) +``` diff --git a/docs/examples/messaging/update-apns-provider.md b/docs/examples/messaging/update-apns-provider.md index f8c12e88..35c14a1a 100644 --- a/docs/examples/messaging/update-apns-provider.md +++ b/docs/examples/messaging/update-apns-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateAPNSProvider( messaging.WithUpdateAPNSProviderBundleId(""), messaging.WithUpdateAPNSProviderSandbox(false), ) +``` diff --git a/docs/examples/messaging/update-email.md b/docs/examples/messaging/update-email.md index 91d6ad90..c2af766b 100644 --- a/docs/examples/messaging/update-email.md +++ b/docs/examples/messaging/update-email.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.UpdateEmail( messaging.WithUpdateEmailScheduledAt(""), messaging.WithUpdateEmailAttachments([]interface{}{}), ) +``` diff --git a/docs/examples/messaging/update-fcm-provider.md b/docs/examples/messaging/update-fcm-provider.md index 28fd9153..9dad736b 100644 --- a/docs/examples/messaging/update-fcm-provider.md +++ b/docs/examples/messaging/update-fcm-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.UpdateFCMProvider( messaging.WithUpdateFCMProviderEnabled(false), messaging.WithUpdateFCMProviderServiceAccountJSON(map[string]interface{}{}), ) +``` diff --git a/docs/examples/messaging/update-mailgun-provider.md b/docs/examples/messaging/update-mailgun-provider.md index d5f17b3d..cfc39cf0 100644 --- a/docs/examples/messaging/update-mailgun-provider.md +++ b/docs/examples/messaging/update-mailgun-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -26,3 +26,4 @@ response, error := service.UpdateMailgunProvider( messaging.WithUpdateMailgunProviderReplyToName(""), messaging.WithUpdateMailgunProviderReplyToEmail(""), ) +``` diff --git a/docs/examples/messaging/update-msg-91-provider.md b/docs/examples/messaging/update-msg-91-provider.md index 825d2d49..a4ef402b 100644 --- a/docs/examples/messaging/update-msg-91-provider.md +++ b/docs/examples/messaging/update-msg-91-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateMsg91Provider( messaging.WithUpdateMsg91ProviderSenderId(""), messaging.WithUpdateMsg91ProviderAuthKey(""), ) +``` diff --git a/docs/examples/messaging/update-push.md b/docs/examples/messaging/update-push.md index d364159e..408c4499 100644 --- a/docs/examples/messaging/update-push.md +++ b/docs/examples/messaging/update-push.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -35,3 +35,4 @@ response, error := service.UpdatePush( messaging.WithUpdatePushCritical(false), messaging.WithUpdatePushPriority("normal"), ) +``` diff --git a/docs/examples/messaging/update-resend-provider.md b/docs/examples/messaging/update-resend-provider.md index d67320f4..a789f94c 100644 --- a/docs/examples/messaging/update-resend-provider.md +++ b/docs/examples/messaging/update-resend-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateResendProvider( messaging.WithUpdateResendProviderReplyToName(""), messaging.WithUpdateResendProviderReplyToEmail(""), ) +``` diff --git a/docs/examples/messaging/update-sendgrid-provider.md b/docs/examples/messaging/update-sendgrid-provider.md index 4a9f822c..a4e2ccbb 100644 --- a/docs/examples/messaging/update-sendgrid-provider.md +++ b/docs/examples/messaging/update-sendgrid-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateSendgridProvider( messaging.WithUpdateSendgridProviderReplyToName(""), messaging.WithUpdateSendgridProviderReplyToEmail(""), ) +``` diff --git a/docs/examples/messaging/update-sms.md b/docs/examples/messaging/update-sms.md index 988de200..6e2a1c4f 100644 --- a/docs/examples/messaging/update-sms.md +++ b/docs/examples/messaging/update-sms.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateSMS( messaging.WithUpdateSMSDraft(false), messaging.WithUpdateSMSScheduledAt(""), ) +``` diff --git a/docs/examples/messaging/update-smtp-provider.md b/docs/examples/messaging/update-smtp-provider.md index 15197501..134e179a 100644 --- a/docs/examples/messaging/update-smtp-provider.md +++ b/docs/examples/messaging/update-smtp-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -30,3 +30,4 @@ response, error := service.UpdateSMTPProvider( messaging.WithUpdateSMTPProviderReplyToEmail(""), messaging.WithUpdateSMTPProviderEnabled(false), ) +``` diff --git a/docs/examples/messaging/update-telesign-provider.md b/docs/examples/messaging/update-telesign-provider.md index d00c6b6e..17754740 100644 --- a/docs/examples/messaging/update-telesign-provider.md +++ b/docs/examples/messaging/update-telesign-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTelesignProvider( messaging.WithUpdateTelesignProviderApiKey(""), messaging.WithUpdateTelesignProviderFrom(""), ) +``` diff --git a/docs/examples/messaging/update-textmagic-provider.md b/docs/examples/messaging/update-textmagic-provider.md index 38e1bed2..fc6a2bad 100644 --- a/docs/examples/messaging/update-textmagic-provider.md +++ b/docs/examples/messaging/update-textmagic-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTextmagicProvider( messaging.WithUpdateTextmagicProviderApiKey(""), messaging.WithUpdateTextmagicProviderFrom(""), ) +``` diff --git a/docs/examples/messaging/update-topic.md b/docs/examples/messaging/update-topic.md index f7c0044b..b99be27f 100644 --- a/docs/examples/messaging/update-topic.md +++ b/docs/examples/messaging/update-topic.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.UpdateTopic( messaging.WithUpdateTopicName(""), messaging.WithUpdateTopicSubscribe(interface{}{"any"}), ) +``` diff --git a/docs/examples/messaging/update-twilio-provider.md b/docs/examples/messaging/update-twilio-provider.md index 644d6d87..3593e3f8 100644 --- a/docs/examples/messaging/update-twilio-provider.md +++ b/docs/examples/messaging/update-twilio-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTwilioProvider( messaging.WithUpdateTwilioProviderAuthToken(""), messaging.WithUpdateTwilioProviderFrom(""), ) +``` diff --git a/docs/examples/messaging/update-vonage-provider.md b/docs/examples/messaging/update-vonage-provider.md index 01ebeb33..55fd8935 100644 --- a/docs/examples/messaging/update-vonage-provider.md +++ b/docs/examples/messaging/update-vonage-provider.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateVonageProvider( messaging.WithUpdateVonageProviderApiSecret(""), messaging.WithUpdateVonageProviderFrom(""), ) +``` diff --git a/docs/examples/organizations/delete.md b/docs/examples/organizations/delete.md new file mode 100644 index 00000000..586f12aa --- /dev/null +++ b/docs/examples/organizations/delete.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/organizations" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := organizations.New(client) + +response, error := service.Delete( + "", +) +``` diff --git a/docs/examples/organizations/estimation-delete-organization.md b/docs/examples/organizations/estimation-delete-organization.md new file mode 100644 index 00000000..d33528a8 --- /dev/null +++ b/docs/examples/organizations/estimation-delete-organization.md @@ -0,0 +1,20 @@ +```gopackage main + +import ( + "fmt" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/organizations" +) + +client := client.New( + client.WithEndpoint("https://.cloud.appwrite.io/v1") + client.WithProject("") + client.WithSession("") +) + +service := organizations.New(client) + +response, error := service.EstimationDeleteOrganization( + "", +) +``` diff --git a/docs/examples/sites/create-deployment.md b/docs/examples/sites/create-deployment.md index 1c853723..0812343e 100644 --- a/docs/examples/sites/create-deployment.md +++ b/docs/examples/sites/create-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateDeployment( sites.WithCreateDeploymentBuildCommand(""), sites.WithCreateDeploymentOutputDirectory(""), ) +``` diff --git a/docs/examples/sites/create-duplicate-deployment.md b/docs/examples/sites/create-duplicate-deployment.md index 177dc48b..91991a8c 100644 --- a/docs/examples/sites/create-duplicate-deployment.md +++ b/docs/examples/sites/create-duplicate-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.CreateDuplicateDeployment( "", "", ) +``` diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 85bf2a3c..ba250521 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateTemplateDeployment( "", sites.WithCreateTemplateDeploymentActivate(false), ) +``` diff --git a/docs/examples/sites/create-variable.md b/docs/examples/sites/create-variable.md index 7681f0d5..89e901db 100644 --- a/docs/examples/sites/create-variable.md +++ b/docs/examples/sites/create-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateVariable( "", sites.WithCreateVariableSecret(false), ) +``` diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 2e39147d..e864a4af 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateVcsDeployment( "", sites.WithCreateVcsDeploymentActivate(false), ) +``` diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index e011baf9..0f96d3bd 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -34,3 +34,4 @@ response, error := service.Create( sites.WithCreateProviderRootDirectory(""), sites.WithCreateSpecification(""), ) +``` diff --git a/docs/examples/sites/delete-deployment.md b/docs/examples/sites/delete-deployment.md index 36d31334..54fb88bd 100644 --- a/docs/examples/sites/delete-deployment.md +++ b/docs/examples/sites/delete-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteDeployment( "", "", ) +``` diff --git a/docs/examples/sites/delete-log.md b/docs/examples/sites/delete-log.md index 34a77611..d1c4214c 100644 --- a/docs/examples/sites/delete-log.md +++ b/docs/examples/sites/delete-log.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteLog( "", "", ) +``` diff --git a/docs/examples/sites/delete-variable.md b/docs/examples/sites/delete-variable.md index 00e6c5c4..5bd7eb6f 100644 --- a/docs/examples/sites/delete-variable.md +++ b/docs/examples/sites/delete-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteVariable( "", "", ) +``` diff --git a/docs/examples/sites/delete.md b/docs/examples/sites/delete.md index 4a93cdb1..3b91edb2 100644 --- a/docs/examples/sites/delete.md +++ b/docs/examples/sites/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := sites.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index b3f1101b..e035f95a 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetDeploymentDownload( "", sites.WithGetDeploymentDownloadType("source"), ) +``` diff --git a/docs/examples/sites/get-deployment.md b/docs/examples/sites/get-deployment.md index 28f49174..adfd5432 100644 --- a/docs/examples/sites/get-deployment.md +++ b/docs/examples/sites/get-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetDeployment( "", "", ) +``` diff --git a/docs/examples/sites/get-log.md b/docs/examples/sites/get-log.md index 1d5aacb2..bd2615a0 100644 --- a/docs/examples/sites/get-log.md +++ b/docs/examples/sites/get-log.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetLog( "", "", ) +``` diff --git a/docs/examples/sites/get-variable.md b/docs/examples/sites/get-variable.md index 91f1a0d1..b6e4cf4c 100644 --- a/docs/examples/sites/get-variable.md +++ b/docs/examples/sites/get-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetVariable( "", "", ) +``` diff --git a/docs/examples/sites/get.md b/docs/examples/sites/get.md index 9c1f38da..4f648750 100644 --- a/docs/examples/sites/get.md +++ b/docs/examples/sites/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := sites.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/sites/list-deployments.md b/docs/examples/sites/list-deployments.md index 626e89c8..64bfb4e1 100644 --- a/docs/examples/sites/list-deployments.md +++ b/docs/examples/sites/list-deployments.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListDeployments( sites.WithListDeploymentsSearch(""), sites.WithListDeploymentsTotal(false), ) +``` diff --git a/docs/examples/sites/list-frameworks.md b/docs/examples/sites/list-frameworks.md index d876ac1a..1432172f 100644 --- a/docs/examples/sites/list-frameworks.md +++ b/docs/examples/sites/list-frameworks.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := sites.New(client) response, error := service.ListFrameworks()) +``` diff --git a/docs/examples/sites/list-logs.md b/docs/examples/sites/list-logs.md index 969c7660..764e3f52 100644 --- a/docs/examples/sites/list-logs.md +++ b/docs/examples/sites/list-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListLogs( sites.WithListLogsQueries([]interface{}{}), sites.WithListLogsTotal(false), ) +``` diff --git a/docs/examples/sites/list-specifications.md b/docs/examples/sites/list-specifications.md index f3a46b22..50e65c98 100644 --- a/docs/examples/sites/list-specifications.md +++ b/docs/examples/sites/list-specifications.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -15,3 +15,4 @@ client := client.New( service := sites.New(client) response, error := service.ListSpecifications()) +``` diff --git a/docs/examples/sites/list-variables.md b/docs/examples/sites/list-variables.md index 18d1e480..c6f2d525 100644 --- a/docs/examples/sites/list-variables.md +++ b/docs/examples/sites/list-variables.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := sites.New(client) response, error := service.ListVariables( "", ) +``` diff --git a/docs/examples/sites/list.md b/docs/examples/sites/list.md index b6b39ebf..1be9a3fe 100644 --- a/docs/examples/sites/list.md +++ b/docs/examples/sites/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( sites.WithListSearch(""), sites.WithListTotal(false), ) +``` diff --git a/docs/examples/sites/update-deployment-status.md b/docs/examples/sites/update-deployment-status.md index 29dad9b1..a903b104 100644 --- a/docs/examples/sites/update-deployment-status.md +++ b/docs/examples/sites/update-deployment-status.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateDeploymentStatus( "", "", ) +``` diff --git a/docs/examples/sites/update-site-deployment.md b/docs/examples/sites/update-site-deployment.md index 176d6410..0da851cc 100644 --- a/docs/examples/sites/update-site-deployment.md +++ b/docs/examples/sites/update-site-deployment.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateSiteDeployment( "", "", ) +``` diff --git a/docs/examples/sites/update-variable.md b/docs/examples/sites/update-variable.md index 99879be7..65eb96c7 100644 --- a/docs/examples/sites/update-variable.md +++ b/docs/examples/sites/update-variable.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdateVariable( sites.WithUpdateVariableValue(""), sites.WithUpdateVariableSecret(false), ) +``` diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index fee0eb8b..c4b51a54 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -34,3 +34,4 @@ response, error := service.Update( sites.WithUpdateProviderRootDirectory(""), sites.WithUpdateSpecification(""), ) +``` diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 7bec2acb..ab2e7585 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -27,3 +27,4 @@ response, error := service.CreateBucket( storage.WithCreateBucketAntivirus(false), storage.WithCreateBucketTransformations(false), ) +``` diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index b195c66a..6ef78081 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateFile( file.NewInputFile("/path/to/file.png", "file.png"), storage.WithCreateFilePermissions(interface{}{"read("any")"}), ) +``` diff --git a/docs/examples/storage/delete-bucket.md b/docs/examples/storage/delete-bucket.md index 8142212a..78b1130f 100644 --- a/docs/examples/storage/delete-bucket.md +++ b/docs/examples/storage/delete-bucket.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := storage.New(client) response, error := service.DeleteBucket( "", ) +``` diff --git a/docs/examples/storage/delete-file.md b/docs/examples/storage/delete-file.md index af3f921c..f096b8d5 100644 --- a/docs/examples/storage/delete-file.md +++ b/docs/examples/storage/delete-file.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteFile( "", "", ) +``` diff --git a/docs/examples/storage/get-bucket.md b/docs/examples/storage/get-bucket.md index c52ebbe0..a694eb2c 100644 --- a/docs/examples/storage/get-bucket.md +++ b/docs/examples/storage/get-bucket.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := storage.New(client) response, error := service.GetBucket( "", ) +``` diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index bc1d7333..a8ebc8f4 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetFileDownload( "", storage.WithGetFileDownloadToken(""), ) +``` diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index 956fbd19..50606e7b 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -30,3 +30,4 @@ response, error := service.GetFilePreview( storage.WithGetFilePreviewOutput("jpg"), storage.WithGetFilePreviewToken(""), ) +``` diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index a2189750..9863f325 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetFileView( "", storage.WithGetFileViewToken(""), ) +``` diff --git a/docs/examples/storage/get-file.md b/docs/examples/storage/get-file.md index 383d4052..6c971a39 100644 --- a/docs/examples/storage/get-file.md +++ b/docs/examples/storage/get-file.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetFile( "", "", ) +``` diff --git a/docs/examples/storage/list-buckets.md b/docs/examples/storage/list-buckets.md index 34b7ee78..2b8e0e56 100644 --- a/docs/examples/storage/list-buckets.md +++ b/docs/examples/storage/list-buckets.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListBuckets( storage.WithListBucketsSearch(""), storage.WithListBucketsTotal(false), ) +``` diff --git a/docs/examples/storage/list-files.md b/docs/examples/storage/list-files.md index d764f53a..98c2870e 100644 --- a/docs/examples/storage/list-files.md +++ b/docs/examples/storage/list-files.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListFiles( storage.WithListFilesSearch(""), storage.WithListFilesTotal(false), ) +``` diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index 7092c688..4400ac7a 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -27,3 +27,4 @@ response, error := service.UpdateBucket( storage.WithUpdateBucketAntivirus(false), storage.WithUpdateBucketTransformations(false), ) +``` diff --git a/docs/examples/storage/update-file.md b/docs/examples/storage/update-file.md index 79a75bab..832b5169 100644 --- a/docs/examples/storage/update-file.md +++ b/docs/examples/storage/update-file.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.UpdateFile( storage.WithUpdateFileName(""), storage.WithUpdateFilePermissions(interface{}{"read("any")"}), ) +``` diff --git a/docs/examples/tablesdb/create-boolean-column.md b/docs/examples/tablesdb/create-boolean-column.md index 6b356154..8cbb0bcb 100644 --- a/docs/examples/tablesdb/create-boolean-column.md +++ b/docs/examples/tablesdb/create-boolean-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateBooleanColumn( tablesdb.WithCreateBooleanColumnDefault(false), tablesdb.WithCreateBooleanColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-datetime-column.md b/docs/examples/tablesdb/create-datetime-column.md index 24a8aa75..9aeb34d1 100644 --- a/docs/examples/tablesdb/create-datetime-column.md +++ b/docs/examples/tablesdb/create-datetime-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateDatetimeColumn( tablesdb.WithCreateDatetimeColumnDefault(""), tablesdb.WithCreateDatetimeColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-email-column.md b/docs/examples/tablesdb/create-email-column.md index 918b3785..4be8468d 100644 --- a/docs/examples/tablesdb/create-email-column.md +++ b/docs/examples/tablesdb/create-email-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateEmailColumn( tablesdb.WithCreateEmailColumnDefault("email@example.com"), tablesdb.WithCreateEmailColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-enum-column.md b/docs/examples/tablesdb/create-enum-column.md index 9eaef4be..ba2ea3e4 100644 --- a/docs/examples/tablesdb/create-enum-column.md +++ b/docs/examples/tablesdb/create-enum-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateEnumColumn( tablesdb.WithCreateEnumColumnDefault(""), tablesdb.WithCreateEnumColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-float-column.md b/docs/examples/tablesdb/create-float-column.md index f630565e..5b49596b 100644 --- a/docs/examples/tablesdb/create-float-column.md +++ b/docs/examples/tablesdb/create-float-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateFloatColumn( tablesdb.WithCreateFloatColumnDefault(0), tablesdb.WithCreateFloatColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-index.md b/docs/examples/tablesdb/create-index.md index fb292b99..17fb5a6b 100644 --- a/docs/examples/tablesdb/create-index.md +++ b/docs/examples/tablesdb/create-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateIndex( tablesdb.WithCreateIndexOrders([]interface{}{}), tablesdb.WithCreateIndexLengths([]interface{}{}), ) +``` diff --git a/docs/examples/tablesdb/create-integer-column.md b/docs/examples/tablesdb/create-integer-column.md index a56f5eec..cde5a199 100644 --- a/docs/examples/tablesdb/create-integer-column.md +++ b/docs/examples/tablesdb/create-integer-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateIntegerColumn( tablesdb.WithCreateIntegerColumnDefault(0), tablesdb.WithCreateIntegerColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-ip-column.md b/docs/examples/tablesdb/create-ip-column.md index 358b4cfa..1c3a85ca 100644 --- a/docs/examples/tablesdb/create-ip-column.md +++ b/docs/examples/tablesdb/create-ip-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateIpColumn( tablesdb.WithCreateIpColumnDefault(""), tablesdb.WithCreateIpColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-line-column.md b/docs/examples/tablesdb/create-line-column.md index 77b23f87..2b9c936a 100644 --- a/docs/examples/tablesdb/create-line-column.md +++ b/docs/examples/tablesdb/create-line-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreateLineColumn( false, tablesdb.WithCreateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), ) +``` diff --git a/docs/examples/tablesdb/create-longtext-column.md b/docs/examples/tablesdb/create-longtext-column.md index 910816db..e70c5f82 100644 --- a/docs/examples/tablesdb/create-longtext-column.md +++ b/docs/examples/tablesdb/create-longtext-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateLongtextColumn( tablesdb.WithCreateLongtextColumnDefault(""), tablesdb.WithCreateLongtextColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-mediumtext-column.md b/docs/examples/tablesdb/create-mediumtext-column.md index caed1975..d0be55dd 100644 --- a/docs/examples/tablesdb/create-mediumtext-column.md +++ b/docs/examples/tablesdb/create-mediumtext-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateMediumtextColumn( tablesdb.WithCreateMediumtextColumnDefault(""), tablesdb.WithCreateMediumtextColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-operations.md b/docs/examples/tablesdb/create-operations.md index 330ece2b..cfa6af89 100644 --- a/docs/examples/tablesdb/create-operations.md +++ b/docs/examples/tablesdb/create-operations.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.CreateOperations( } }), ) +``` diff --git a/docs/examples/tablesdb/create-point-column.md b/docs/examples/tablesdb/create-point-column.md index 7faaf786..4cc55ca2 100644 --- a/docs/examples/tablesdb/create-point-column.md +++ b/docs/examples/tablesdb/create-point-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreatePointColumn( false, tablesdb.WithCreatePointColumnDefault(interface{}{1, 2}), ) +``` diff --git a/docs/examples/tablesdb/create-polygon-column.md b/docs/examples/tablesdb/create-polygon-column.md index 10946ef0..cbe41a69 100644 --- a/docs/examples/tablesdb/create-polygon-column.md +++ b/docs/examples/tablesdb/create-polygon-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreatePolygonColumn( false, tablesdb.WithCreatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), ) +``` diff --git a/docs/examples/tablesdb/create-relationship-column.md b/docs/examples/tablesdb/create-relationship-column.md index 04235097..54234cde 100644 --- a/docs/examples/tablesdb/create-relationship-column.md +++ b/docs/examples/tablesdb/create-relationship-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateRelationshipColumn( tablesdb.WithCreateRelationshipColumnTwoWayKey(""), tablesdb.WithCreateRelationshipColumnOnDelete("cascade"), ) +``` diff --git a/docs/examples/tablesdb/create-row.md b/docs/examples/tablesdb/create-row.md index 24054ace..8b80923c 100644 --- a/docs/examples/tablesdb/create-row.md +++ b/docs/examples/tablesdb/create-row.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.CreateRow( tablesdb.WithCreateRowPermissions(interface{}{"read("any")"}), tablesdb.WithCreateRowTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/create-rows.md b/docs/examples/tablesdb/create-rows.md index 6ddeb067..5e21ac39 100644 --- a/docs/examples/tablesdb/create-rows.md +++ b/docs/examples/tablesdb/create-rows.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateRows( []interface{}{}, tablesdb.WithCreateRowsTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/create-string-column.md b/docs/examples/tablesdb/create-string-column.md index b31f5838..d216f315 100644 --- a/docs/examples/tablesdb/create-string-column.md +++ b/docs/examples/tablesdb/create-string-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateStringColumn( tablesdb.WithCreateStringColumnArray(false), tablesdb.WithCreateStringColumnEncrypt(false), ) +``` diff --git a/docs/examples/tablesdb/create-table.md b/docs/examples/tablesdb/create-table.md index c5e1826f..d0f641d5 100644 --- a/docs/examples/tablesdb/create-table.md +++ b/docs/examples/tablesdb/create-table.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.CreateTable( tablesdb.WithCreateTableColumns([]interface{}{}), tablesdb.WithCreateTableIndexes([]interface{}{}), ) +``` diff --git a/docs/examples/tablesdb/create-text-column.md b/docs/examples/tablesdb/create-text-column.md index 2b989d4a..ac0bdebf 100644 --- a/docs/examples/tablesdb/create-text-column.md +++ b/docs/examples/tablesdb/create-text-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTextColumn( tablesdb.WithCreateTextColumnDefault(""), tablesdb.WithCreateTextColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-transaction.md b/docs/examples/tablesdb/create-transaction.md index 165f897c..329f3832 100644 --- a/docs/examples/tablesdb/create-transaction.md +++ b/docs/examples/tablesdb/create-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.CreateTransaction( tablesdb.WithCreateTransactionTtl(60), ) +``` diff --git a/docs/examples/tablesdb/create-url-column.md b/docs/examples/tablesdb/create-url-column.md index 55abd168..6ef93582 100644 --- a/docs/examples/tablesdb/create-url-column.md +++ b/docs/examples/tablesdb/create-url-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateUrlColumn( tablesdb.WithCreateUrlColumnDefault("https://example.com"), tablesdb.WithCreateUrlColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create-varchar-column.md b/docs/examples/tablesdb/create-varchar-column.md index 99cce5dc..a7fb0b8d 100644 --- a/docs/examples/tablesdb/create-varchar-column.md +++ b/docs/examples/tablesdb/create-varchar-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateVarcharColumn( tablesdb.WithCreateVarcharColumnDefault(""), tablesdb.WithCreateVarcharColumnArray(false), ) +``` diff --git a/docs/examples/tablesdb/create.md b/docs/examples/tablesdb/create.md index d09b6aea..0e166483 100644 --- a/docs/examples/tablesdb/create.md +++ b/docs/examples/tablesdb/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.Create( "", tablesdb.WithCreateEnabled(false), ) +``` diff --git a/docs/examples/tablesdb/decrement-row-column.md b/docs/examples/tablesdb/decrement-row-column.md index a74bdda2..3e8c07fa 100644 --- a/docs/examples/tablesdb/decrement-row-column.md +++ b/docs/examples/tablesdb/decrement-row-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.DecrementRowColumn( tablesdb.WithDecrementRowColumnMin(0), tablesdb.WithDecrementRowColumnTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/delete-column.md b/docs/examples/tablesdb/delete-column.md index 475f4a4e..7f2d05e2 100644 --- a/docs/examples/tablesdb/delete-column.md +++ b/docs/examples/tablesdb/delete-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.DeleteColumn( "", "", ) +``` diff --git a/docs/examples/tablesdb/delete-index.md b/docs/examples/tablesdb/delete-index.md index 2c3b7759..aa39c4f8 100644 --- a/docs/examples/tablesdb/delete-index.md +++ b/docs/examples/tablesdb/delete-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.DeleteIndex( "", "", ) +``` diff --git a/docs/examples/tablesdb/delete-row.md b/docs/examples/tablesdb/delete-row.md index 39338452..25ef2f4d 100644 --- a/docs/examples/tablesdb/delete-row.md +++ b/docs/examples/tablesdb/delete-row.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.DeleteRow( "", tablesdb.WithDeleteRowTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/delete-rows.md b/docs/examples/tablesdb/delete-rows.md index b9fa49b5..0b6a8f84 100644 --- a/docs/examples/tablesdb/delete-rows.md +++ b/docs/examples/tablesdb/delete-rows.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.DeleteRows( tablesdb.WithDeleteRowsQueries([]interface{}{}), tablesdb.WithDeleteRowsTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/delete-table.md b/docs/examples/tablesdb/delete-table.md index 9274fc61..3e727d91 100644 --- a/docs/examples/tablesdb/delete-table.md +++ b/docs/examples/tablesdb/delete-table.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteTable( "", "", ) +``` diff --git a/docs/examples/tablesdb/delete-transaction.md b/docs/examples/tablesdb/delete-transaction.md index 16ee0505..bb3227cd 100644 --- a/docs/examples/tablesdb/delete-transaction.md +++ b/docs/examples/tablesdb/delete-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.DeleteTransaction( "", ) +``` diff --git a/docs/examples/tablesdb/delete.md b/docs/examples/tablesdb/delete.md index fb00bf06..d25cf1de 100644 --- a/docs/examples/tablesdb/delete.md +++ b/docs/examples/tablesdb/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/tablesdb/get-column.md b/docs/examples/tablesdb/get-column.md index 2cb626f9..8af6ece6 100644 --- a/docs/examples/tablesdb/get-column.md +++ b/docs/examples/tablesdb/get-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetColumn( "", "", ) +``` diff --git a/docs/examples/tablesdb/get-index.md b/docs/examples/tablesdb/get-index.md index a289d5ef..eca7875c 100644 --- a/docs/examples/tablesdb/get-index.md +++ b/docs/examples/tablesdb/get-index.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.GetIndex( "", "", ) +``` diff --git a/docs/examples/tablesdb/get-row.md b/docs/examples/tablesdb/get-row.md index 025c6b55..e979dd0b 100644 --- a/docs/examples/tablesdb/get-row.md +++ b/docs/examples/tablesdb/get-row.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.GetRow( tablesdb.WithGetRowQueries([]interface{}{}), tablesdb.WithGetRowTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/get-table.md b/docs/examples/tablesdb/get-table.md index eb42f82c..b9669719 100644 --- a/docs/examples/tablesdb/get-table.md +++ b/docs/examples/tablesdb/get-table.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetTable( "", "", ) +``` diff --git a/docs/examples/tablesdb/get-transaction.md b/docs/examples/tablesdb/get-transaction.md index d478007b..3e61d85b 100644 --- a/docs/examples/tablesdb/get-transaction.md +++ b/docs/examples/tablesdb/get-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.GetTransaction( "", ) +``` diff --git a/docs/examples/tablesdb/get.md b/docs/examples/tablesdb/get.md index 9bf18901..76ce9ee3 100644 --- a/docs/examples/tablesdb/get.md +++ b/docs/examples/tablesdb/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/tablesdb/increment-row-column.md b/docs/examples/tablesdb/increment-row-column.md index 4548f3cb..7f70d12d 100644 --- a/docs/examples/tablesdb/increment-row-column.md +++ b/docs/examples/tablesdb/increment-row-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.IncrementRowColumn( tablesdb.WithIncrementRowColumnMax(0), tablesdb.WithIncrementRowColumnTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/list-columns.md b/docs/examples/tablesdb/list-columns.md index 9a7f4099..85808790 100644 --- a/docs/examples/tablesdb/list-columns.md +++ b/docs/examples/tablesdb/list-columns.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListColumns( tablesdb.WithListColumnsQueries([]interface{}{}), tablesdb.WithListColumnsTotal(false), ) +``` diff --git a/docs/examples/tablesdb/list-indexes.md b/docs/examples/tablesdb/list-indexes.md index 826c55dc..95902ea1 100644 --- a/docs/examples/tablesdb/list-indexes.md +++ b/docs/examples/tablesdb/list-indexes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListIndexes( tablesdb.WithListIndexesQueries([]interface{}{}), tablesdb.WithListIndexesTotal(false), ) +``` diff --git a/docs/examples/tablesdb/list-rows.md b/docs/examples/tablesdb/list-rows.md index 5a421ef6..3d1bc88b 100644 --- a/docs/examples/tablesdb/list-rows.md +++ b/docs/examples/tablesdb/list-rows.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.ListRows( tablesdb.WithListRowsTransactionId(""), tablesdb.WithListRowsTotal(false), ) +``` diff --git a/docs/examples/tablesdb/list-tables.md b/docs/examples/tablesdb/list-tables.md index b9f77145..51b87c78 100644 --- a/docs/examples/tablesdb/list-tables.md +++ b/docs/examples/tablesdb/list-tables.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListTables( tablesdb.WithListTablesSearch(""), tablesdb.WithListTablesTotal(false), ) +``` diff --git a/docs/examples/tablesdb/list-transactions.md b/docs/examples/tablesdb/list-transactions.md index 7379d855..c3d1138f 100644 --- a/docs/examples/tablesdb/list-transactions.md +++ b/docs/examples/tablesdb/list-transactions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tablesdb.New(client) response, error := service.ListTransactions( tablesdb.WithListTransactionsQueries([]interface{}{}), ) +``` diff --git a/docs/examples/tablesdb/list.md b/docs/examples/tablesdb/list.md index aba33d9c..493342fa 100644 --- a/docs/examples/tablesdb/list.md +++ b/docs/examples/tablesdb/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( tablesdb.WithListSearch(""), tablesdb.WithListTotal(false), ) +``` diff --git a/docs/examples/tablesdb/update-boolean-column.md b/docs/examples/tablesdb/update-boolean-column.md index 9b0bdd30..c6f8c6a9 100644 --- a/docs/examples/tablesdb/update-boolean-column.md +++ b/docs/examples/tablesdb/update-boolean-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateBooleanColumn( false, tablesdb.WithUpdateBooleanColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-datetime-column.md b/docs/examples/tablesdb/update-datetime-column.md index 9c406cae..955ba1fa 100644 --- a/docs/examples/tablesdb/update-datetime-column.md +++ b/docs/examples/tablesdb/update-datetime-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateDatetimeColumn( "", tablesdb.WithUpdateDatetimeColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-email-column.md b/docs/examples/tablesdb/update-email-column.md index 74483f31..920b035d 100644 --- a/docs/examples/tablesdb/update-email-column.md +++ b/docs/examples/tablesdb/update-email-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateEmailColumn( "email@example.com", tablesdb.WithUpdateEmailColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-enum-column.md b/docs/examples/tablesdb/update-enum-column.md index f2151725..c2d6c278 100644 --- a/docs/examples/tablesdb/update-enum-column.md +++ b/docs/examples/tablesdb/update-enum-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateEnumColumn( "", tablesdb.WithUpdateEnumColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-float-column.md b/docs/examples/tablesdb/update-float-column.md index 9daf2c22..3f440fa4 100644 --- a/docs/examples/tablesdb/update-float-column.md +++ b/docs/examples/tablesdb/update-float-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateFloatColumn( tablesdb.WithUpdateFloatColumnMax(0), tablesdb.WithUpdateFloatColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-integer-column.md b/docs/examples/tablesdb/update-integer-column.md index 86a11352..a8bfcd52 100644 --- a/docs/examples/tablesdb/update-integer-column.md +++ b/docs/examples/tablesdb/update-integer-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -24,3 +24,4 @@ response, error := service.UpdateIntegerColumn( tablesdb.WithUpdateIntegerColumnMax(0), tablesdb.WithUpdateIntegerColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-ip-column.md b/docs/examples/tablesdb/update-ip-column.md index 1c4bdb4f..7ff8880e 100644 --- a/docs/examples/tablesdb/update-ip-column.md +++ b/docs/examples/tablesdb/update-ip-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateIpColumn( "", tablesdb.WithUpdateIpColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-line-column.md b/docs/examples/tablesdb/update-line-column.md index 397e0b73..1cc52e18 100644 --- a/docs/examples/tablesdb/update-line-column.md +++ b/docs/examples/tablesdb/update-line-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateLineColumn( tablesdb.WithUpdateLineColumnDefault(interface{}{[1, 2], [3, 4], [5, 6]}), tablesdb.WithUpdateLineColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-longtext-column.md b/docs/examples/tablesdb/update-longtext-column.md index 604e35c0..0c6884f2 100644 --- a/docs/examples/tablesdb/update-longtext-column.md +++ b/docs/examples/tablesdb/update-longtext-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateLongtextColumn( "", tablesdb.WithUpdateLongtextColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-mediumtext-column.md b/docs/examples/tablesdb/update-mediumtext-column.md index 144cd744..4cea1945 100644 --- a/docs/examples/tablesdb/update-mediumtext-column.md +++ b/docs/examples/tablesdb/update-mediumtext-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateMediumtextColumn( "", tablesdb.WithUpdateMediumtextColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-point-column.md b/docs/examples/tablesdb/update-point-column.md index 970536a6..2bc417a6 100644 --- a/docs/examples/tablesdb/update-point-column.md +++ b/docs/examples/tablesdb/update-point-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdatePointColumn( tablesdb.WithUpdatePointColumnDefault(interface{}{1, 2}), tablesdb.WithUpdatePointColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-polygon-column.md b/docs/examples/tablesdb/update-polygon-column.md index 8e627d17..3fa00d86 100644 --- a/docs/examples/tablesdb/update-polygon-column.md +++ b/docs/examples/tablesdb/update-polygon-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdatePolygonColumn( tablesdb.WithUpdatePolygonColumnDefault(interface{}{[[1, 2], [3, 4], [5, 6], [1, 2]]}), tablesdb.WithUpdatePolygonColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-relationship-column.md b/docs/examples/tablesdb/update-relationship-column.md index ed923a2d..52614c99 100644 --- a/docs/examples/tablesdb/update-relationship-column.md +++ b/docs/examples/tablesdb/update-relationship-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdateRelationshipColumn( tablesdb.WithUpdateRelationshipColumnOnDelete("cascade"), tablesdb.WithUpdateRelationshipColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-row.md b/docs/examples/tablesdb/update-row.md index 212be5b2..43f7bb49 100644 --- a/docs/examples/tablesdb/update-row.md +++ b/docs/examples/tablesdb/update-row.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.UpdateRow( tablesdb.WithUpdateRowPermissions(interface{}{"read("any")"}), tablesdb.WithUpdateRowTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/update-rows.md b/docs/examples/tablesdb/update-rows.md index 706abaee..57043152 100644 --- a/docs/examples/tablesdb/update-rows.md +++ b/docs/examples/tablesdb/update-rows.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -27,3 +27,4 @@ response, error := service.UpdateRows( tablesdb.WithUpdateRowsQueries([]interface{}{}), tablesdb.WithUpdateRowsTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/update-string-column.md b/docs/examples/tablesdb/update-string-column.md index 4366602b..f312df08 100644 --- a/docs/examples/tablesdb/update-string-column.md +++ b/docs/examples/tablesdb/update-string-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateStringColumn( tablesdb.WithUpdateStringColumnSize(1), tablesdb.WithUpdateStringColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-table.md b/docs/examples/tablesdb/update-table.md index a40cd597..22406bd7 100644 --- a/docs/examples/tablesdb/update-table.md +++ b/docs/examples/tablesdb/update-table.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTable( tablesdb.WithUpdateTableRowSecurity(false), tablesdb.WithUpdateTableEnabled(false), ) +``` diff --git a/docs/examples/tablesdb/update-text-column.md b/docs/examples/tablesdb/update-text-column.md index dc417872..68228aa7 100644 --- a/docs/examples/tablesdb/update-text-column.md +++ b/docs/examples/tablesdb/update-text-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateTextColumn( "", tablesdb.WithUpdateTextColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-transaction.md b/docs/examples/tablesdb/update-transaction.md index 9842a455..97f31426 100644 --- a/docs/examples/tablesdb/update-transaction.md +++ b/docs/examples/tablesdb/update-transaction.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.UpdateTransaction( tablesdb.WithUpdateTransactionCommit(false), tablesdb.WithUpdateTransactionRollback(false), ) +``` diff --git a/docs/examples/tablesdb/update-url-column.md b/docs/examples/tablesdb/update-url-column.md index 998d0e77..8e470067 100644 --- a/docs/examples/tablesdb/update-url-column.md +++ b/docs/examples/tablesdb/update-url-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.UpdateUrlColumn( "https://example.com", tablesdb.WithUpdateUrlColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update-varchar-column.md b/docs/examples/tablesdb/update-varchar-column.md index 97dfb744..b43f4a65 100644 --- a/docs/examples/tablesdb/update-varchar-column.md +++ b/docs/examples/tablesdb/update-varchar-column.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.UpdateVarcharColumn( tablesdb.WithUpdateVarcharColumnSize(1), tablesdb.WithUpdateVarcharColumnNewKey(""), ) +``` diff --git a/docs/examples/tablesdb/update.md b/docs/examples/tablesdb/update.md index 47641efc..36aab8ed 100644 --- a/docs/examples/tablesdb/update.md +++ b/docs/examples/tablesdb/update.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.Update( tablesdb.WithUpdateName(""), tablesdb.WithUpdateEnabled(false), ) +``` diff --git a/docs/examples/tablesdb/upsert-row.md b/docs/examples/tablesdb/upsert-row.md index 097b3550..6c225ed7 100644 --- a/docs/examples/tablesdb/upsert-row.md +++ b/docs/examples/tablesdb/upsert-row.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -28,3 +28,4 @@ response, error := service.UpsertRow( tablesdb.WithUpsertRowPermissions(interface{}{"read("any")"}), tablesdb.WithUpsertRowTransactionId(""), ) +``` diff --git a/docs/examples/tablesdb/upsert-rows.md b/docs/examples/tablesdb/upsert-rows.md index a74d6ee9..2fa6772c 100644 --- a/docs/examples/tablesdb/upsert-rows.md +++ b/docs/examples/tablesdb/upsert-rows.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.UpsertRows( []interface{}{}, tablesdb.WithUpsertRowsTransactionId(""), ) +``` diff --git a/docs/examples/teams/create-membership.md b/docs/examples/teams/create-membership.md index b8a71c18..39838c7d 100644 --- a/docs/examples/teams/create-membership.md +++ b/docs/examples/teams/create-membership.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateMembership( teams.WithCreateMembershipUrl("https://example.com"), teams.WithCreateMembershipName(""), ) +``` diff --git a/docs/examples/teams/create.md b/docs/examples/teams/create.md index 0a0fa5aa..c8287a15 100644 --- a/docs/examples/teams/create.md +++ b/docs/examples/teams/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.Create( "", teams.WithCreateRoles([]interface{}{}), ) +``` diff --git a/docs/examples/teams/delete-membership.md b/docs/examples/teams/delete-membership.md index 1d9e1983..3f5d0864 100644 --- a/docs/examples/teams/delete-membership.md +++ b/docs/examples/teams/delete-membership.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteMembership( "", "", ) +``` diff --git a/docs/examples/teams/delete.md b/docs/examples/teams/delete.md index 8cf9892d..3500cd3d 100644 --- a/docs/examples/teams/delete.md +++ b/docs/examples/teams/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := teams.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/teams/get-membership.md b/docs/examples/teams/get-membership.md index 47d63bbb..9d4bce87 100644 --- a/docs/examples/teams/get-membership.md +++ b/docs/examples/teams/get-membership.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetMembership( "", "", ) +``` diff --git a/docs/examples/teams/get-prefs.md b/docs/examples/teams/get-prefs.md index fd487d2c..10dc2e29 100644 --- a/docs/examples/teams/get-prefs.md +++ b/docs/examples/teams/get-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := teams.New(client) response, error := service.GetPrefs( "", ) +``` diff --git a/docs/examples/teams/get.md b/docs/examples/teams/get.md index 64dfb9b6..c68d5602 100644 --- a/docs/examples/teams/get.md +++ b/docs/examples/teams/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := teams.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/teams/list-memberships.md b/docs/examples/teams/list-memberships.md index 8b71afe7..38c3a98b 100644 --- a/docs/examples/teams/list-memberships.md +++ b/docs/examples/teams/list-memberships.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListMemberships( teams.WithListMembershipsSearch(""), teams.WithListMembershipsTotal(false), ) +``` diff --git a/docs/examples/teams/list.md b/docs/examples/teams/list.md index 17776372..8cb1935e 100644 --- a/docs/examples/teams/list.md +++ b/docs/examples/teams/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( teams.WithListSearch(""), teams.WithListTotal(false), ) +``` diff --git a/docs/examples/teams/update-membership-status.md b/docs/examples/teams/update-membership-status.md index 72bb53e0..48a56a9a 100644 --- a/docs/examples/teams/update-membership-status.md +++ b/docs/examples/teams/update-membership-status.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.UpdateMembershipStatus( "", "", ) +``` diff --git a/docs/examples/teams/update-membership.md b/docs/examples/teams/update-membership.md index 4bfde072..60c98abb 100644 --- a/docs/examples/teams/update-membership.md +++ b/docs/examples/teams/update-membership.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.UpdateMembership( "", []interface{}{}, ) +``` diff --git a/docs/examples/teams/update-name.md b/docs/examples/teams/update-name.md index 02fba6b4..b1c8a105 100644 --- a/docs/examples/teams/update-name.md +++ b/docs/examples/teams/update-name.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateName( "", "", ) +``` diff --git a/docs/examples/teams/update-prefs.md b/docs/examples/teams/update-prefs.md index a5f44c07..a7a08984 100644 --- a/docs/examples/teams/update-prefs.md +++ b/docs/examples/teams/update-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePrefs( "", map[string]interface{}{}, ) +``` diff --git a/docs/examples/tokens/create-file-token.md b/docs/examples/tokens/create-file-token.md index b05e5f7e..1a91211f 100644 --- a/docs/examples/tokens/create-file-token.md +++ b/docs/examples/tokens/create-file-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateFileToken( "", tokens.WithCreateFileTokenExpire(""), ) +``` diff --git a/docs/examples/tokens/delete.md b/docs/examples/tokens/delete.md index 807ba410..dd9ec5ca 100644 --- a/docs/examples/tokens/delete.md +++ b/docs/examples/tokens/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tokens.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/tokens/get.md b/docs/examples/tokens/get.md index 277e4621..a1da068c 100644 --- a/docs/examples/tokens/get.md +++ b/docs/examples/tokens/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := tokens.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/tokens/list.md b/docs/examples/tokens/list.md index e84ee1e3..dd97e7b9 100644 --- a/docs/examples/tokens/list.md +++ b/docs/examples/tokens/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.List( tokens.WithListQueries([]interface{}{}), tokens.WithListTotal(false), ) +``` diff --git a/docs/examples/tokens/update.md b/docs/examples/tokens/update.md index b4bbc547..06fd47bb 100644 --- a/docs/examples/tokens/update.md +++ b/docs/examples/tokens/update.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.Update( "", tokens.WithUpdateExpire(""), ) +``` diff --git a/docs/examples/users/create-argon-2-user.md b/docs/examples/users/create-argon-2-user.md index f5b651a1..53fd9df7 100644 --- a/docs/examples/users/create-argon-2-user.md +++ b/docs/examples/users/create-argon-2-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateArgon2User( "password", users.WithCreateArgon2UserName(""), ) +``` diff --git a/docs/examples/users/create-bcrypt-user.md b/docs/examples/users/create-bcrypt-user.md index b021f96f..d1b70a3b 100644 --- a/docs/examples/users/create-bcrypt-user.md +++ b/docs/examples/users/create-bcrypt-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateBcryptUser( "password", users.WithCreateBcryptUserName(""), ) +``` diff --git a/docs/examples/users/create-jwt.md b/docs/examples/users/create-jwt.md index 426f832b..16fc507f 100644 --- a/docs/examples/users/create-jwt.md +++ b/docs/examples/users/create-jwt.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateJWT( users.WithCreateJWTSessionId(""), users.WithCreateJWTDuration(0), ) +``` diff --git a/docs/examples/users/create-md-5-user.md b/docs/examples/users/create-md-5-user.md index 0da3f687..d700ca01 100644 --- a/docs/examples/users/create-md-5-user.md +++ b/docs/examples/users/create-md-5-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreateMD5User( "password", users.WithCreateMD5UserName(""), ) +``` diff --git a/docs/examples/users/create-mfa-recovery-codes.md b/docs/examples/users/create-mfa-recovery-codes.md index 4808f633..56a886d6 100644 --- a/docs/examples/users/create-mfa-recovery-codes.md +++ b/docs/examples/users/create-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.CreateMFARecoveryCodes( "", ) +``` diff --git a/docs/examples/users/create-ph-pass-user.md b/docs/examples/users/create-ph-pass-user.md index 28e77e37..635fa95e 100644 --- a/docs/examples/users/create-ph-pass-user.md +++ b/docs/examples/users/create-ph-pass-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.CreatePHPassUser( "password", users.WithCreatePHPassUserName(""), ) +``` diff --git a/docs/examples/users/create-scrypt-modified-user.md b/docs/examples/users/create-scrypt-modified-user.md index 51cc11bf..a729da2e 100644 --- a/docs/examples/users/create-scrypt-modified-user.md +++ b/docs/examples/users/create-scrypt-modified-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -23,3 +23,4 @@ response, error := service.CreateScryptModifiedUser( "", users.WithCreateScryptModifiedUserName(""), ) +``` diff --git a/docs/examples/users/create-scrypt-user.md b/docs/examples/users/create-scrypt-user.md index a64fcfbb..9bbad82f 100644 --- a/docs/examples/users/create-scrypt-user.md +++ b/docs/examples/users/create-scrypt-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -25,3 +25,4 @@ response, error := service.CreateScryptUser( 0, users.WithCreateScryptUserName(""), ) +``` diff --git a/docs/examples/users/create-session.md b/docs/examples/users/create-session.md index 7bbd39de..ce2274d1 100644 --- a/docs/examples/users/create-session.md +++ b/docs/examples/users/create-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.CreateSession( "", ) +``` diff --git a/docs/examples/users/create-sha-user.md b/docs/examples/users/create-sha-user.md index 72115985..c86ef43d 100644 --- a/docs/examples/users/create-sha-user.md +++ b/docs/examples/users/create-sha-user.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.CreateSHAUser( users.WithCreateSHAUserPasswordVersion("sha1"), users.WithCreateSHAUserName(""), ) +``` diff --git a/docs/examples/users/create-target.md b/docs/examples/users/create-target.md index 8d4f2841..b2fcfa3c 100644 --- a/docs/examples/users/create-target.md +++ b/docs/examples/users/create-target.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -22,3 +22,4 @@ response, error := service.CreateTarget( users.WithCreateTargetProviderId(""), users.WithCreateTargetName(""), ) +``` diff --git a/docs/examples/users/create-token.md b/docs/examples/users/create-token.md index 44d96c1f..24819206 100644 --- a/docs/examples/users/create-token.md +++ b/docs/examples/users/create-token.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.CreateToken( users.WithCreateTokenLength(4), users.WithCreateTokenExpire(60), ) +``` diff --git a/docs/examples/users/create.md b/docs/examples/users/create.md index b4d1afca..67efc1f5 100644 --- a/docs/examples/users/create.md +++ b/docs/examples/users/create.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.Create( users.WithCreatePassword(""), users.WithCreateName(""), ) +``` diff --git a/docs/examples/users/delete-identity.md b/docs/examples/users/delete-identity.md index 14baa660..d30bd7b5 100644 --- a/docs/examples/users/delete-identity.md +++ b/docs/examples/users/delete-identity.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.DeleteIdentity( "", ) +``` diff --git a/docs/examples/users/delete-mfa-authenticator.md b/docs/examples/users/delete-mfa-authenticator.md index d32a5c3e..70032f0c 100644 --- a/docs/examples/users/delete-mfa-authenticator.md +++ b/docs/examples/users/delete-mfa-authenticator.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteMFAAuthenticator( "", "totp", ) +``` diff --git a/docs/examples/users/delete-session.md b/docs/examples/users/delete-session.md index 3162ae92..739e68f8 100644 --- a/docs/examples/users/delete-session.md +++ b/docs/examples/users/delete-session.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteSession( "", "", ) +``` diff --git a/docs/examples/users/delete-sessions.md b/docs/examples/users/delete-sessions.md index 8d0bbfc1..a34165e7 100644 --- a/docs/examples/users/delete-sessions.md +++ b/docs/examples/users/delete-sessions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.DeleteSessions( "", ) +``` diff --git a/docs/examples/users/delete-target.md b/docs/examples/users/delete-target.md index 2fa4ae91..f5f4652a 100644 --- a/docs/examples/users/delete-target.md +++ b/docs/examples/users/delete-target.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.DeleteTarget( "", "", ) +``` diff --git a/docs/examples/users/delete.md b/docs/examples/users/delete.md index 72a4122b..275ed291 100644 --- a/docs/examples/users/delete.md +++ b/docs/examples/users/delete.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.Delete( "", ) +``` diff --git a/docs/examples/users/get-mfa-recovery-codes.md b/docs/examples/users/get-mfa-recovery-codes.md index ff24b6ff..c715a5e9 100644 --- a/docs/examples/users/get-mfa-recovery-codes.md +++ b/docs/examples/users/get-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.GetMFARecoveryCodes( "", ) +``` diff --git a/docs/examples/users/get-prefs.md b/docs/examples/users/get-prefs.md index e4a05d1c..baefd165 100644 --- a/docs/examples/users/get-prefs.md +++ b/docs/examples/users/get-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.GetPrefs( "", ) +``` diff --git a/docs/examples/users/get-target.md b/docs/examples/users/get-target.md index b4b99c7e..3bbb9ced 100644 --- a/docs/examples/users/get-target.md +++ b/docs/examples/users/get-target.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.GetTarget( "", "", ) +``` diff --git a/docs/examples/users/get.md b/docs/examples/users/get.md index 85a8440d..027de175 100644 --- a/docs/examples/users/get.md +++ b/docs/examples/users/get.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.Get( "", ) +``` diff --git a/docs/examples/users/list-identities.md b/docs/examples/users/list-identities.md index 9858a2a2..a90722fd 100644 --- a/docs/examples/users/list-identities.md +++ b/docs/examples/users/list-identities.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListIdentities( users.WithListIdentitiesSearch(""), users.WithListIdentitiesTotal(false), ) +``` diff --git a/docs/examples/users/list-logs.md b/docs/examples/users/list-logs.md index d3b2840b..b0d43f9a 100644 --- a/docs/examples/users/list-logs.md +++ b/docs/examples/users/list-logs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListLogs( users.WithListLogsQueries([]interface{}{}), users.WithListLogsTotal(false), ) +``` diff --git a/docs/examples/users/list-memberships.md b/docs/examples/users/list-memberships.md index 28b96dae..e549b806 100644 --- a/docs/examples/users/list-memberships.md +++ b/docs/examples/users/list-memberships.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -20,3 +20,4 @@ response, error := service.ListMemberships( users.WithListMembershipsSearch(""), users.WithListMembershipsTotal(false), ) +``` diff --git a/docs/examples/users/list-mfa-factors.md b/docs/examples/users/list-mfa-factors.md index 9a3c3263..73eb2ae0 100644 --- a/docs/examples/users/list-mfa-factors.md +++ b/docs/examples/users/list-mfa-factors.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.ListMFAFactors( "", ) +``` diff --git a/docs/examples/users/list-sessions.md b/docs/examples/users/list-sessions.md index 60ccd788..cc1be952 100644 --- a/docs/examples/users/list-sessions.md +++ b/docs/examples/users/list-sessions.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.ListSessions( "", users.WithListSessionsTotal(false), ) +``` diff --git a/docs/examples/users/list-targets.md b/docs/examples/users/list-targets.md index 1e738825..668b4aa7 100644 --- a/docs/examples/users/list-targets.md +++ b/docs/examples/users/list-targets.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.ListTargets( users.WithListTargetsQueries([]interface{}{}), users.WithListTargetsTotal(false), ) +``` diff --git a/docs/examples/users/list.md b/docs/examples/users/list.md index b50a818f..d8e10dd6 100644 --- a/docs/examples/users/list.md +++ b/docs/examples/users/list.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -19,3 +19,4 @@ response, error := service.List( users.WithListSearch(""), users.WithListTotal(false), ) +``` diff --git a/docs/examples/users/update-email-verification.md b/docs/examples/users/update-email-verification.md index c2326b4c..16471be5 100644 --- a/docs/examples/users/update-email-verification.md +++ b/docs/examples/users/update-email-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateEmailVerification( "", false, ) +``` diff --git a/docs/examples/users/update-email.md b/docs/examples/users/update-email.md index ac3938a6..3e88c9d0 100644 --- a/docs/examples/users/update-email.md +++ b/docs/examples/users/update-email.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateEmail( "", "email@example.com", ) +``` diff --git a/docs/examples/users/update-labels.md b/docs/examples/users/update-labels.md index 01c37f53..96e56c2b 100644 --- a/docs/examples/users/update-labels.md +++ b/docs/examples/users/update-labels.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateLabels( "", []interface{}{}, ) +``` diff --git a/docs/examples/users/update-mfa-recovery-codes.md b/docs/examples/users/update-mfa-recovery-codes.md index f79ac5c5..60d35982 100644 --- a/docs/examples/users/update-mfa-recovery-codes.md +++ b/docs/examples/users/update-mfa-recovery-codes.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -17,3 +17,4 @@ service := users.New(client) response, error := service.UpdateMFARecoveryCodes( "", ) +``` diff --git a/docs/examples/users/update-mfa.md b/docs/examples/users/update-mfa.md index 9cff007f..92042ee9 100644 --- a/docs/examples/users/update-mfa.md +++ b/docs/examples/users/update-mfa.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateMFA( "", false, ) +``` diff --git a/docs/examples/users/update-name.md b/docs/examples/users/update-name.md index 73255e25..af06cc55 100644 --- a/docs/examples/users/update-name.md +++ b/docs/examples/users/update-name.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateName( "", "", ) +``` diff --git a/docs/examples/users/update-password.md b/docs/examples/users/update-password.md index 5aa6e9ef..64e838d9 100644 --- a/docs/examples/users/update-password.md +++ b/docs/examples/users/update-password.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePassword( "", "", ) +``` diff --git a/docs/examples/users/update-phone-verification.md b/docs/examples/users/update-phone-verification.md index e90febf7..60727a43 100644 --- a/docs/examples/users/update-phone-verification.md +++ b/docs/examples/users/update-phone-verification.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePhoneVerification( "", false, ) +``` diff --git a/docs/examples/users/update-phone.md b/docs/examples/users/update-phone.md index 602a012a..98750707 100644 --- a/docs/examples/users/update-phone.md +++ b/docs/examples/users/update-phone.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePhone( "", "+12065550100", ) +``` diff --git a/docs/examples/users/update-prefs.md b/docs/examples/users/update-prefs.md index dd607f3c..3f4926fc 100644 --- a/docs/examples/users/update-prefs.md +++ b/docs/examples/users/update-prefs.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdatePrefs( "", map[string]interface{}{}, ) +``` diff --git a/docs/examples/users/update-status.md b/docs/examples/users/update-status.md index f93dde9c..391bb1b2 100644 --- a/docs/examples/users/update-status.md +++ b/docs/examples/users/update-status.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -18,3 +18,4 @@ response, error := service.UpdateStatus( "", false, ) +``` diff --git a/docs/examples/users/update-target.md b/docs/examples/users/update-target.md index 82f3d65d..3529b117 100644 --- a/docs/examples/users/update-target.md +++ b/docs/examples/users/update-target.md @@ -1,4 +1,4 @@ -package main +```gopackage main import ( "fmt" @@ -21,3 +21,4 @@ response, error := service.UpdateTarget( users.WithUpdateTargetProviderId(""), users.WithUpdateTargetName(""), ) +``` diff --git a/health/health.go b/health/health.go index a32f9a8f..c02f233b 100644 --- a/health/health.go +++ b/health/health.go @@ -295,6 +295,118 @@ func (srv *Health) GetQueueAudits(optionalSetters ...GetQueueAuditsOption)(*mode } return &parsed, nil +} +type GetQueueBillingProjectAggregationOptions struct { + Threshold int + enabledSetters map[string]bool +} +func (options GetQueueBillingProjectAggregationOptions) New() *GetQueueBillingProjectAggregationOptions { + options.enabledSetters = map[string]bool{ + "Threshold": false, + } + return &options +} +type GetQueueBillingProjectAggregationOption func(*GetQueueBillingProjectAggregationOptions) +func (srv *Health) WithGetQueueBillingProjectAggregationThreshold(v int) GetQueueBillingProjectAggregationOption { + return func(o *GetQueueBillingProjectAggregationOptions) { + o.Threshold = v + o.enabledSetters["Threshold"] = true + } +} + +// GetQueueBillingProjectAggregation get billing project aggregation queue. +func (srv *Health) GetQueueBillingProjectAggregation(optionalSetters ...GetQueueBillingProjectAggregationOption)(*models.HealthQueue, error) { + path := "/health/queue/billing-project-aggregation" + options := GetQueueBillingProjectAggregationOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Threshold"] { + params["threshold"] = options.Threshold + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.HealthQueue{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.HealthQueue + parsed, ok := resp.Result.(models.HealthQueue) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} +type GetQueueBillingTeamAggregationOptions struct { + Threshold int + enabledSetters map[string]bool +} +func (options GetQueueBillingTeamAggregationOptions) New() *GetQueueBillingTeamAggregationOptions { + options.enabledSetters = map[string]bool{ + "Threshold": false, + } + return &options +} +type GetQueueBillingTeamAggregationOption func(*GetQueueBillingTeamAggregationOptions) +func (srv *Health) WithGetQueueBillingTeamAggregationThreshold(v int) GetQueueBillingTeamAggregationOption { + return func(o *GetQueueBillingTeamAggregationOptions) { + o.Threshold = v + o.enabledSetters["Threshold"] = true + } +} + +// GetQueueBillingTeamAggregation get billing team aggregation queue. +func (srv *Health) GetQueueBillingTeamAggregation(optionalSetters ...GetQueueBillingTeamAggregationOption)(*models.HealthQueue, error) { + path := "/health/queue/billing-team-aggregation" + options := GetQueueBillingTeamAggregationOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Threshold"] { + params["threshold"] = options.Threshold + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.HealthQueue{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.HealthQueue + parsed, ok := resp.Result.(models.HealthQueue) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + } type GetQueueBuildsOptions struct { Threshold int @@ -352,6 +464,62 @@ func (srv *Health) GetQueueBuilds(optionalSetters ...GetQueueBuildsOption)(*mode } return &parsed, nil +} +type GetQueuePriorityBuildsOptions struct { + Threshold int + enabledSetters map[string]bool +} +func (options GetQueuePriorityBuildsOptions) New() *GetQueuePriorityBuildsOptions { + options.enabledSetters = map[string]bool{ + "Threshold": false, + } + return &options +} +type GetQueuePriorityBuildsOption func(*GetQueuePriorityBuildsOptions) +func (srv *Health) WithGetQueuePriorityBuildsThreshold(v int) GetQueuePriorityBuildsOption { + return func(o *GetQueuePriorityBuildsOptions) { + o.Threshold = v + o.enabledSetters["Threshold"] = true + } +} + +// GetQueuePriorityBuilds get the priority builds queue size. +func (srv *Health) GetQueuePriorityBuilds(optionalSetters ...GetQueuePriorityBuildsOption)(*models.HealthQueue, error) { + path := "/health/queue/builds-priority" + options := GetQueuePriorityBuildsOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Threshold"] { + params["threshold"] = options.Threshold + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.HealthQueue{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.HealthQueue + parsed, ok := resp.Result.(models.HealthQueue) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + } type GetQueueCertificatesOptions struct { Threshold int @@ -878,6 +1046,62 @@ func (srv *Health) GetQueueMigrations(optionalSetters ...GetQueueMigrationsOptio } return &parsed, nil +} +type GetQueueRegionManagerOptions struct { + Threshold int + enabledSetters map[string]bool +} +func (options GetQueueRegionManagerOptions) New() *GetQueueRegionManagerOptions { + options.enabledSetters = map[string]bool{ + "Threshold": false, + } + return &options +} +type GetQueueRegionManagerOption func(*GetQueueRegionManagerOptions) +func (srv *Health) WithGetQueueRegionManagerThreshold(v int) GetQueueRegionManagerOption { + return func(o *GetQueueRegionManagerOptions) { + o.Threshold = v + o.enabledSetters["Threshold"] = true + } +} + +// GetQueueRegionManager get region manager queue. +func (srv *Health) GetQueueRegionManager(optionalSetters ...GetQueueRegionManagerOption)(*models.HealthQueue, error) { + path := "/health/queue/region-manager" + options := GetQueueRegionManagerOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Threshold"] { + params["threshold"] = options.Threshold + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.HealthQueue{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.HealthQueue + parsed, ok := resp.Result.(models.HealthQueue) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + } type GetQueueStatsResourcesOptions struct { Threshold int @@ -992,6 +1216,62 @@ func (srv *Health) GetQueueUsage(optionalSetters ...GetQueueUsageOption)(*models } return &parsed, nil +} +type GetQueueThreatsOptions struct { + Threshold int + enabledSetters map[string]bool +} +func (options GetQueueThreatsOptions) New() *GetQueueThreatsOptions { + options.enabledSetters = map[string]bool{ + "Threshold": false, + } + return &options +} +type GetQueueThreatsOption func(*GetQueueThreatsOptions) +func (srv *Health) WithGetQueueThreatsThreshold(v int) GetQueueThreatsOption { + return func(o *GetQueueThreatsOptions) { + o.Threshold = v + o.enabledSetters["Threshold"] = true + } +} + +// GetQueueThreats get threats queue. +func (srv *Health) GetQueueThreats(optionalSetters ...GetQueueThreatsOption)(*models.HealthQueue, error) { + path := "/health/queue/threats" + options := GetQueueThreatsOptions{}.New() + for _, opt := range optionalSetters { + opt(options) + } + params := map[string]interface{}{} + if options.enabledSetters["Threshold"] { + params["threshold"] = options.Threshold + } + headers := map[string]interface{}{ + } + + resp, err := srv.client.Call("GET", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.HealthQueue{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.HealthQueue + parsed, ok := resp.Result.(models.HealthQueue) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + } type GetQueueWebhooksOptions struct { Threshold int diff --git a/models/backup_archive.go b/models/backup_archive.go new file mode 100644 index 00000000..88b0395e --- /dev/null +++ b/models/backup_archive.go @@ -0,0 +1,58 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// Archive Model +type BackupArchive struct { + // Archive ID. + Id string `json:"$id"` + // Archive creation time in ISO 8601 format. + CreatedAt string `json:"$createdAt"` + // Archive update date in ISO 8601 format. + UpdatedAt string `json:"$updatedAt"` + // Archive policy ID. + PolicyId string `json:"policyId"` + // Archive size in bytes. + Size int `json:"size"` + // The status of the archive creation. Possible values: pending, processing, + // uploading, completed, failed. + Status string `json:"status"` + // The backup start time. + StartedAt string `json:"startedAt"` + // Migration ID. + MigrationId string `json:"migrationId"` + // The services that are backed up by this archive. + Services []string `json:"services"` + // The resources that are backed up by this archive. + Resources []string `json:"resources"` + // The resource ID to backup. Set only if this archive should backup a single + // resource. + ResourceId string `json:"resourceId"` + // The resource type to backup. Set only if this archive should backup a + // single resource. + ResourceType string `json:"resourceType"` + + // Used by Decode() method + data []byte +} + +func (model BackupArchive) New(data []byte) *BackupArchive { + model.data = data + return &model +} + +func (model *BackupArchive) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/backup_archive_list.go b/models/backup_archive_list.go new file mode 100644 index 00000000..8aebff87 --- /dev/null +++ b/models/backup_archive_list.go @@ -0,0 +1,35 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// BackupArchiveList Model +type BackupArchiveList struct { + // Total number of archives that matched your query. + Total int `json:"total"` + // List of archives. + Archives []BackupArchive `json:"archives"` + + // Used by Decode() method + data []byte +} + +func (model BackupArchiveList) New(data []byte) *BackupArchiveList { + model.data = data + return &model +} + +func (model *BackupArchiveList) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/backup_policy.go b/models/backup_policy.go new file mode 100644 index 00000000..015e190f --- /dev/null +++ b/models/backup_policy.go @@ -0,0 +1,55 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// Backup Model +type BackupPolicy struct { + // Backup policy ID. + Id string `json:"$id"` + // Backup policy name. + Name string `json:"name"` + // Policy creation date in ISO 8601 format. + CreatedAt string `json:"$createdAt"` + // Policy update date in ISO 8601 format. + UpdatedAt string `json:"$updatedAt"` + // The services that are backed up by this policy. + Services []string `json:"services"` + // The resources that are backed up by this policy. + Resources []string `json:"resources"` + // The resource ID to backup. Set only if this policy should backup a single + // resource. + ResourceId string `json:"resourceId"` + // The resource type to backup. Set only if this policy should backup a single + // resource. + ResourceType string `json:"resourceType"` + // How many days to keep the backup before it will be automatically deleted. + Retention int `json:"retention"` + // Policy backup schedule in CRON format. + Schedule string `json:"schedule"` + // Is this policy enabled. + Enabled bool `json:"enabled"` + + // Used by Decode() method + data []byte +} + +func (model BackupPolicy) New(data []byte) *BackupPolicy { + model.data = data + return &model +} + +func (model *BackupPolicy) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/backup_policy_list.go b/models/backup_policy_list.go new file mode 100644 index 00000000..fc2056df --- /dev/null +++ b/models/backup_policy_list.go @@ -0,0 +1,35 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// BackupPolicyList Model +type BackupPolicyList struct { + // Total number of policies that matched your query. + Total int `json:"total"` + // List of policies. + Policies []BackupPolicy `json:"policies"` + + // Used by Decode() method + data []byte +} + +func (model BackupPolicyList) New(data []byte) *BackupPolicyList { + model.data = data + return &model +} + +func (model *BackupPolicyList) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/backup_restoration.go b/models/backup_restoration.go new file mode 100644 index 00000000..56518e5c --- /dev/null +++ b/models/backup_restoration.go @@ -0,0 +1,54 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// Restoration Model +type BackupRestoration struct { + // Restoration ID. + Id string `json:"$id"` + // Restoration creation time in ISO 8601 format. + CreatedAt string `json:"$createdAt"` + // Restoration update date in ISO 8601 format. + UpdatedAt string `json:"$updatedAt"` + // Backup archive ID. + ArchiveId string `json:"archiveId"` + // Backup policy ID. + PolicyId string `json:"policyId"` + // The status of the restoration. Possible values: pending, downloading, + // processing, completed, failed. + Status string `json:"status"` + // The backup start time. + StartedAt string `json:"startedAt"` + // Migration ID. + MigrationId string `json:"migrationId"` + // The services that are backed up by this policy. + Services []string `json:"services"` + // The resources that are backed up by this policy. + Resources []string `json:"resources"` + // Optional data in key-value object. + Options string `json:"options"` + + // Used by Decode() method + data []byte +} + +func (model BackupRestoration) New(data []byte) *BackupRestoration { + model.data = data + return &model +} + +func (model *BackupRestoration) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/backup_restoration_list.go b/models/backup_restoration_list.go new file mode 100644 index 00000000..cb038e50 --- /dev/null +++ b/models/backup_restoration_list.go @@ -0,0 +1,35 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// BackupRestorationList Model +type BackupRestorationList struct { + // Total number of restorations that matched your query. + Total int `json:"total"` + // List of restorations. + Restorations []BackupRestoration `json:"restorations"` + + // Used by Decode() method + data []byte +} + +func (model BackupRestorationList) New(data []byte) *BackupRestorationList { + model.data = data + return &model +} + +func (model *BackupRestorationList) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/collection.go b/models/collection.go index b1b8fcaa..806fecbf 100644 --- a/models/collection.go +++ b/models/collection.go @@ -31,6 +31,10 @@ type Collection struct { Attributes []map[string]any `json:"attributes"` // Collection indexes. Indexes []Index `json:"indexes"` + // Maximum document size in bytes. Returns 0 when no limit applies. + BytesMax int `json:"bytesMax"` + // Currently used document size in bytes based on defined attributes. + BytesUsed int `json:"bytesUsed"` // Used by Decode() method data []byte diff --git a/models/database.go b/models/database.go index df410bab..2d81fe7e 100644 --- a/models/database.go +++ b/models/database.go @@ -21,6 +21,10 @@ type Database struct { Enabled bool `json:"enabled"` // Database type. Type string `json:"type"` + // Database backup policies. + Policies []Index `json:"policies"` + // Database backup archives. + Archives []Collection `json:"archives"` // Used by Decode() method data []byte diff --git a/models/estimation_delete_organization.go b/models/estimation_delete_organization.go new file mode 100644 index 00000000..4d4fe0ba --- /dev/null +++ b/models/estimation_delete_organization.go @@ -0,0 +1,33 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// EstimationDeleteOrganization Model +type EstimationDeleteOrganization struct { + // List of unpaid invoices + UnpaidInvoices []Invoice `json:"unpaidInvoices"` + + // Used by Decode() method + data []byte +} + +func (model EstimationDeleteOrganization) New(data []byte) *EstimationDeleteOrganization { + model.data = data + return &model +} + +func (model *EstimationDeleteOrganization) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/invoice.go b/models/invoice.go new file mode 100644 index 00000000..2003b1e9 --- /dev/null +++ b/models/invoice.go @@ -0,0 +1,75 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// Invoice Model +type Invoice struct { + // Invoice ID. + Id string `json:"$id"` + // Invoice creation time in ISO 8601 format. + CreatedAt string `json:"$createdAt"` + // Invoice update date in ISO 8601 format. + UpdatedAt string `json:"$updatedAt"` + // Invoice permissions. [Learn more about permissions](/docs/permissions). + Permissions []string `json:"$permissions"` + // Project ID + TeamId string `json:"teamId"` + // Aggregation ID + AggregationId string `json:"aggregationId"` + // Billing plan selected. Can be one of `tier-0`, `tier-1` or `tier-2`. + Plan string `json:"plan"` + // Usage breakdown per resource + Usage []UsageResources `json:"usage"` + // Invoice Amount + Amount float64 `json:"amount"` + // Tax percentage + Tax float64 `json:"tax"` + // Tax amount + TaxAmount float64 `json:"taxAmount"` + // VAT percentage + Vat float64 `json:"vat"` + // VAT amount + VatAmount float64 `json:"vatAmount"` + // Gross amount after vat, tax, and discounts applied. + GrossAmount float64 `json:"grossAmount"` + // Credits used. + CreditsUsed float64 `json:"creditsUsed"` + // Currency the invoice is in + Currency string `json:"currency"` + // Client secret for processing failed payments in front-end + ClientSecret string `json:"clientSecret"` + // Invoice status + Status string `json:"status"` + // Last payment error associated with the invoice + LastError string `json:"lastError"` + // Invoice due date. + DueAt string `json:"dueAt"` + // Beginning date of the invoice + From string `json:"from"` + // End date of the invoice + To string `json:"to"` + + // Used by Decode() method + data []byte +} + +func (model Invoice) New(data []byte) *Invoice { + model.data = data + return &model +} + +func (model *Invoice) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/key.go b/models/key.go new file mode 100644 index 00000000..31bb79e5 --- /dev/null +++ b/models/key.go @@ -0,0 +1,50 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// Key Model +type Key struct { + // Key ID. + Id string `json:"$id"` + // Key creation date in ISO 8601 format. + CreatedAt string `json:"$createdAt"` + // Key update date in ISO 8601 format. + UpdatedAt string `json:"$updatedAt"` + // Key name. + Name string `json:"name"` + // Key expiration date in ISO 8601 format. + Expire string `json:"expire"` + // Allowed permission scopes. + Scopes []string `json:"scopes"` + // Secret key. + Secret string `json:"secret"` + // Most recent access date in ISO 8601 format. This attribute is only updated + // again after 24 hours. + AccessedAt string `json:"accessedAt"` + // List of SDK user agents that used this key. + Sdks []string `json:"sdks"` + + // Used by Decode() method + data []byte +} + +func (model Key) New(data []byte) *Key { + model.data = data + return &model +} + +func (model *Key) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/key_list.go b/models/key_list.go new file mode 100644 index 00000000..abfc9f6c --- /dev/null +++ b/models/key_list.go @@ -0,0 +1,35 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// APIKeysList Model +type KeyList struct { + // Total number of keys that matched your query. + Total int `json:"total"` + // List of keys. + Keys []Key `json:"keys"` + + // Used by Decode() method + data []byte +} + +func (model KeyList) New(data []byte) *KeyList { + model.data = data + return &model +} + +func (model *KeyList) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/models/table.go b/models/table.go index 09a040b2..906eca2b 100644 --- a/models/table.go +++ b/models/table.go @@ -31,6 +31,10 @@ type Table struct { Columns []interface{} `json:"columns"` // Table indexes. Indexes []ColumnIndex `json:"indexes"` + // Maximum row size in bytes. Returns 0 when no limit applies. + BytesMax int `json:"bytesMax"` + // Currently used row size in bytes based on defined columns. + BytesUsed int `json:"bytesUsed"` // Used by Decode() method data []byte diff --git a/models/usage_resources.go b/models/usage_resources.go new file mode 100644 index 00000000..5123d659 --- /dev/null +++ b/models/usage_resources.go @@ -0,0 +1,43 @@ +package models + +import ( + "encoding/json" + "errors" +) + +// UsageResource Model +type UsageResources struct { + // Invoice name + Name string `json:"name"` + // Invoice value + Value int `json:"value"` + // Invoice amount + Amount float64 `json:"amount"` + // Invoice rate + Rate float64 `json:"rate"` + // Invoice description + Desc string `json:"desc"` + // Resource ID + ResourceId string `json:"resourceId"` + + // Used by Decode() method + data []byte +} + +func (model UsageResources) New(data []byte) *UsageResources { + model.data = data + return &model +} + +func (model *UsageResources) Decode(value interface{}) error { + if len(model.data) <= 0 { + return errors.New("method Decode() cannot be used on nested struct") + } + + err := json.Unmarshal(model.data, value) + if err != nil { + return err + } + + return nil +} \ No newline at end of file diff --git a/organizations/organizations.go b/organizations/organizations.go new file mode 100644 index 00000000..71736d9f --- /dev/null +++ b/organizations/organizations.go @@ -0,0 +1,90 @@ +package organizations + +import ( + "encoding/json" + "errors" + "github.com/appwrite/sdk-for-go/client" + "github.com/appwrite/sdk-for-go/models" + "strings" +) + +// Organizations service +type Organizations struct { + client client.Client +} + +func New(clt client.Client) *Organizations { + return &Organizations{ + client: clt, + } +} + + +// Delete delete an organization. +func (srv *Organizations) Delete(OrganizationId string)(*interface{}, error) { + r := strings.NewReplacer("{organizationId}", OrganizationId) + path := r.Replace("/organizations/{organizationId}") + params := map[string]interface{}{} + params["organizationId"] = OrganizationId + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("DELETE", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + var parsed interface{} + + err = json.Unmarshal(bytes, &parsed) + if err != nil { + return nil, err + } + return &parsed, nil + } + var parsed interface{} + parsed, ok := resp.Result.(interface{}) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +} + +// EstimationDeleteOrganization get estimation for deleting an organization. +func (srv *Organizations) EstimationDeleteOrganization(OrganizationId string)(*models.EstimationDeleteOrganization, error) { + r := strings.NewReplacer("{organizationId}", OrganizationId) + path := r.Replace("/organizations/{organizationId}/estimations/delete-organization") + params := map[string]interface{}{} + params["organizationId"] = OrganizationId + headers := map[string]interface{}{ + "content-type": "application/json", + } + + resp, err := srv.client.Call("PATCH", path, headers, params) + if err != nil { + return nil, err + } + if strings.HasPrefix(resp.Type, "application/json") { + bytes := []byte(resp.Result.(string)) + + parsed := models.EstimationDeleteOrganization{}.New(bytes) + + err = json.Unmarshal(bytes, parsed) + if err != nil { + return nil, err + } + + return parsed, nil + } + var parsed models.EstimationDeleteOrganization + parsed, ok := resp.Result.(models.EstimationDeleteOrganization) + if !ok { + return nil, errors.New("unexpected response type") + } + return &parsed, nil + +}