├── .gitignore ├── generator ├── go.mod ├── go.sum ├── repo.tpl ├── generic_repo.tpl ├── generic_repository.tpl └── entity_repo.tpl ├── example ├── go.sum ├── go.mod └── main.go ├── go.mod ├── go.sum ├── cache_manager.go ├── bulk.go ├── system_config_manager.go ├── LICENSE.md ├── info.go ├── README.md ├── criteria.go ├── theme_manager.go ├── credentials.go ├── repository.go ├── repo_rule_tag.go ├── repo_media_tag.go ├── repo_theme_media.go ├── repo_customer_tag.go ├── repo_order_tag.go ├── repo_theme_child.go ├── repo_version.go ├── repo_product_tag.go ├── repo_category_tag.go ├── repo_flow_template.go ├── repo_integration_role.go ├── repo_promotion_cart_rule.go ├── repo_product_option.go ├── repo_user_recovery.go ├── repo_acl_user_role.go ├── repo_promotion_order_rule.go ├── repo_shipping_method_tag.go ├── repo_theme_sales_channel.go ├── repo_landing_page_tag.go ├── repo_user_config.go ├── repo_product_property.go ├── repo_script.go ├── repo_promotion_persona_rule.go ├── repo_sales_channel_country.go ├── repo_log_entry.go ├── repo_promotion_discount_rule.go ├── repo_promotion_setgroup_rule.go ├── repo_sales_channel_currency.go ├── repo_sales_channel_language.go ├── repo_unit.go ├── repo_customer_recovery.go ├── repo_product_category.go ├── repo_snippet.go ├── repo_tax.go ├── repo_newsletter_recipient_tag.go ├── repo_number_range_state.go ├── repo_app_template.go ├── repo_promotion_persona_customer.go ├── repo_system_config.go ├── repo_media_default_folder.go ├── repo_product_stream_mapping.go ├── repo_acl_role.go ├── repo_product_keyword_dictionary.go ├── repo_mail_template_media.go ├── repo_notification.go ├── repo_product_custom_field_set.go ├── repo_app_flow_event.go ├── repo_product_category_tree.go ├── repo_snippet_set.go ├── repo_webhook.go ├── repo_sales_channel_payment_method.go ├── repo_locale.go ├── repo_sales_channel_shipping_method.go ├── repo_tax_rule_type.go ├── repo_landing_page_sales_channel.go ├── repo_app_administration_snippet.go ├── repo_user_access_key.go ├── repo_media_thumbnail_size.go ├── repo_custom_field_set_relation.go ├── repo_unit_translation.go ├── repo_media_thumbnail.go ├── repo_tax_rule.go ├── repo_media_translation.go ├── repo_import_export_file.go ├── repo_promotion_individual_code.go ├── repo_app_cms_block_translation.go ├── repo_locale_translation.go ├── repo_promotion_setgroup.go ├── repo_tax_rule_type_translation.go ├── repo_promotion_translation.go ├── repo_sales_channel_analytics.go ├── repo_app_translation.go ├── repo_customer_wishlist.go ├── repo_product_visibility.go ├── repo_seo_url_template.go ├── repo_product_feature_set.go ├── repo_scheduled_task.go ├── repo_country_translation.go ├── repo_promotion_sales_channel.go ├── repo_version_commit.go └── repo_app_cms_block.go /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.env 3 | /generator/entity-schema.json -------------------------------------------------------------------------------- /generator/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/friendsofshopware/go-shopware-admin-api-sdk/generator 2 | 3 | go 1.17 4 | 5 | require github.com/iancoleman/strcase v0.2.0 6 | -------------------------------------------------------------------------------- /example/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= 2 | golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= 3 | -------------------------------------------------------------------------------- /generator/go.sum: -------------------------------------------------------------------------------- 1 | github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= 2 | github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= 3 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/friendsofshopware/go-shopware-admin-api-sdk 2 | 3 | go 1.24 4 | 5 | require golang.org/x/oauth2 v0.30.0 6 | 7 | require github.com/shyim/go-version v0.0.0-20250613124056-b64b21f007d8 // indirect 8 | -------------------------------------------------------------------------------- /example/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/friendsofshopware/go-shopware-admin-api-sdk/example 2 | 3 | go 1.24 4 | 5 | toolchain go1.24.4 6 | 7 | replace github.com/friendsofshopware/go-shopware-admin-api-sdk => ../ 8 | 9 | require github.com/friendsofshopware/go-shopware-admin-api-sdk v0.0.0-00010101000000-000000000000 10 | 11 | require golang.org/x/oauth2 v0.30.0 // indirect 12 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/shyim/go-version v0.0.0-20250613124056-b64b21f007d8 h1:YYe5c28qVr4BeEmGYaHQZLKQ7l6eTG6wpGeYbDJQl0k= 2 | github.com/shyim/go-version v0.0.0-20250613124056-b64b21f007d8/go.mod h1:z47ygE4N7EC0H58FP5j5cXZtl1pSnfjwYJsHtiVtcwU= 3 | golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= 4 | golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= 5 | -------------------------------------------------------------------------------- /generator/repo.tpl: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | type Repository struct { 4 | ClientService 5 | 6 | {{ range . }} 7 | {{ . }} *{{ . }}Repository 8 | {{ end }} 9 | } 10 | 11 | func NewRepository(client ClientService) Repository { 12 | repo := Repository{ 13 | ClientService: client, 14 | } 15 | {{ range . }} 16 | repo.{{ . }} = New{{ . }}Repository(client.Client) 17 | {{ end }} 18 | return repo 19 | } 20 | -------------------------------------------------------------------------------- /cache_manager.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type CacheManagerService ClientService 9 | 10 | func (m CacheManagerService) Clear(ctx ApiContext) (*http.Response, error) { 11 | r, err := m.Client.NewRequest(ctx, http.MethodDelete, "/api/_action/cache", nil) 12 | 13 | if err != nil { 14 | return nil, fmt.Errorf("cannot clear cache %w", err) 15 | } 16 | 17 | return m.Client.BareDo(ctx.Context, r) 18 | } 19 | -------------------------------------------------------------------------------- /bulk.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import "net/http" 4 | 5 | type BulkService ClientService 6 | 7 | func (b BulkService) Sync(ctx ApiContext, payload map[string]SyncOperation) (*http.Response, error) { 8 | req, err := b.Client.NewRequest(ctx, http.MethodPost, "/api/_action/sync", payload) 9 | 10 | if err != nil { 11 | return nil, err 12 | } 13 | 14 | return b.Client.Do(ctx.Context, req, nil) 15 | } 16 | 17 | type SyncOperation struct { 18 | Entity string `json:"entity"` 19 | Action string `json:"action"` 20 | Payload interface{} `json:"payload"` 21 | } 22 | -------------------------------------------------------------------------------- /system_config_manager.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | "strings" 6 | ) 7 | 8 | type SystemConfigService ClientService 9 | 10 | func (c SystemConfigService) UpdateConfig(ctx ApiContext, payload string) (*http.Response, error) { 11 | r, err := http.NewRequestWithContext(ctx.Context, http.MethodPost, c.Client.url+"/api/_action/system-config/batch", strings.NewReader(payload)) 12 | 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | r.Header.Set("Content-Type", "application/json") 18 | r.Header.Set("Accept", "application/json") 19 | 20 | return c.Client.BareDo(ctx.Context, r) 21 | } 22 | -------------------------------------------------------------------------------- /example/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "log" 7 | 8 | sdk "github.com/friendsofshopware/go-shopware-admin-api-sdk" 9 | ) 10 | 11 | func main() { 12 | ctx := context.Background() 13 | 14 | creds := sdk.NewPasswordCredentials("admin", "shopware", []string{}) 15 | client, err := sdk.NewApiClient(ctx, "https://demo.fos.gg", creds, nil) 16 | 17 | if err != nil { 18 | log.Fatalln(err) 19 | } 20 | 21 | apiContext := sdk.NewApiContext(ctx) 22 | criteria := sdk.Criteria{} 23 | criteria.Filter = []sdk.CriteriaFilter{{Type: "equals", Field: "parentId", Value: nil}} 24 | 25 | collection, _, _ := client.Repository.Product.Search(apiContext, criteria) 26 | 27 | for _, product := range collection.Data { 28 | fmt.Println(product.Name) 29 | } 30 | 31 | // Get current shopware version 32 | fmt.Println(client.Info.Info(apiContext)) 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Friends of Shopware 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /info.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type InfoService ClientService 9 | 10 | type InfoResponse struct { 11 | Version string `json:"version"` 12 | VersionRevision string `json:"versionRevision"` 13 | AdminWorker struct { 14 | EnableAdminWorker bool `json:"enableAdminWorker"` 15 | Transports []string `json:"transports"` 16 | } `json:"adminWorker"` 17 | Bundles map[string]infoResponseBundle `json:"bundles"` 18 | Settings struct { 19 | EnableURLFeature bool `json:"enableUrlFeature"` 20 | } `json:"settings"` 21 | } 22 | 23 | type infoResponseBundle struct { 24 | CSS []string `json:"css"` 25 | Js []string `json:"js"` 26 | } 27 | 28 | func (r InfoResponse) IsCloudShop() bool { 29 | _, ok := r.Bundles["SaasRufus"] 30 | 31 | return ok 32 | } 33 | 34 | func (s InfoService) Info(ctx ApiContext) (*InfoResponse, *http.Response, error) { 35 | r, err := s.Client.NewRequest(ctx, http.MethodGet, "/api/_info/config", nil) 36 | 37 | if err != nil { 38 | return nil, nil, fmt.Errorf("cannot get info %w", err) 39 | } 40 | 41 | var info *InfoResponse 42 | resp, err := s.Client.Do(ctx.Context, r, &info) 43 | if err != nil { 44 | return nil, nil, err 45 | } 46 | 47 | return info, resp, err 48 | } 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SDK for the Shopware 6 Admin API 2 | 3 | See example folder 4 | 5 | ## Create a client 6 | 7 | ### Password 8 | 9 | ```go 10 | ctx := context.Background() 11 | 12 | // Create a using password grant 13 | creds := sdk.NewPasswordCredentials("", "", []string{"write"}) 14 | client, err := sdk.NewApiClient(ctx, "", creds, nil) 15 | ``` 16 | 17 | ### Integration 18 | 19 | ```go 20 | ctx := context.Background() 21 | 22 | // Create a using password grant 23 | creds := sdk.NewIntegrationCredentials("", "", []string{"write"}) 24 | client, err := sdk.NewApiClient(ctx, "", creds, nil) 25 | ``` 26 | 27 | ## Usage of a repository 28 | 29 | ### Search 30 | 31 | ```go 32 | apiContext := sdk.NewApiContext(ctx) 33 | criteria := sdk.Criteria{} 34 | 35 | collection, _, _ := client.Repository.Tax.Search(apiContext, criteria) 36 | 37 | for _, tax := range collection.Data { 38 | fmt.Println(tax.Name) 39 | } 40 | ``` 41 | 42 | ### Create/Update 43 | 44 | ```go 45 | apiContext := sdk.NewApiContext(ctx) 46 | client.Repository.Tax.Upsert(apiContext, []sdk.Tax{ 47 | {TaxRate: 15, Name: "15%"}, 48 | }) 49 | ``` 50 | 51 | ### Delete 52 | 53 | ```go 54 | apiContext := sdk.NewApiContext(ctx) 55 | client.Repository.Tax.Delete(apiContext, []string{"someid"}) 56 | ``` -------------------------------------------------------------------------------- /criteria.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | const ( 4 | TotalCountModeDefault = 0 5 | TotalCountModeExact = 1 6 | TotalCountModeNextPage = 2 7 | 8 | SearchFilterTypeEquals = "equals" 9 | SearchFilterTypeEqualsAny = "equalsAny" 10 | 11 | SearchSortDirectionAscending = "ASC" 12 | SearchSortDirectionDescending = "DESC" 13 | ) 14 | 15 | type Criteria struct { 16 | Includes map[string][]string `json:"includes,omitempty"` 17 | Page int64 `json:"page,omitempty"` 18 | Limit int64 `json:"limit,omitempty"` 19 | IDs []string `json:"ids,omitempty"` 20 | Filter []CriteriaFilter `json:"filter,omitempty"` 21 | PostFilter []CriteriaFilter `json:"postFilter,omitempty"` 22 | Sort []CriteriaSort `json:"sort,omitempty"` 23 | Associations map[string]Criteria `json:"associations,omitempty"` 24 | Term string `json:"term,omitempty"` 25 | TotalCountMode int `json:"totalCountMode,omitempty"` 26 | } 27 | 28 | type CriteriaFilter struct { 29 | Type string `json:"type"` 30 | Field string `json:"field"` 31 | Value interface{} `json:"value"` 32 | } 33 | 34 | type CriteriaSort struct { 35 | Direction string `json:"order"` 36 | Field string `json:"field"` 37 | NaturalSorting bool `json:"naturalSorting"` 38 | } 39 | -------------------------------------------------------------------------------- /theme_manager.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "net/http" 8 | ) 9 | 10 | type ThemeManagerService ClientService 11 | 12 | func (m ThemeManagerService) GetConfiguration(ctx ApiContext, themeId string) (*ThemeConfiguration, *http.Response, error) { 13 | r, err := m.Client.NewRequest(ctx, http.MethodGet, fmt.Sprintf("/api/_action/theme/%s/configuration", themeId), nil) 14 | 15 | if err != nil { 16 | return nil, nil, fmt.Errorf("cannot get theme configuration %w", err) 17 | } 18 | 19 | var result *ThemeConfiguration 20 | 21 | resp, err := m.Client.Do(ctx.Context, r, &result) 22 | 23 | if err != nil { 24 | return nil, nil, err 25 | } 26 | 27 | // Old shopware version, use fields instead 28 | if result.CurrentFields == nil { 29 | result.CurrentFields = &result.Fields 30 | } 31 | 32 | return result, resp, err 33 | } 34 | 35 | func (m ThemeManagerService) UpdateConfiguration(ctx ApiContext, themeId string, update ThemeUpdateRequest) (*http.Response, error) { 36 | content, err := json.Marshal(update) 37 | 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | r, err := m.Client.NewRequest(ctx, http.MethodPatch, fmt.Sprintf("/api/_action/theme/%s", themeId), bytes.NewReader(content)) 43 | 44 | if err != nil { 45 | return nil, fmt.Errorf("cannot update theme configuration %w", err) 46 | } 47 | 48 | return m.Client.BareDo(ctx.Context, r) 49 | } 50 | 51 | type ThemeConfiguration struct { 52 | CurrentFields *map[string]ThemeConfigValue `json:"currentFields"` 53 | Fields map[string]ThemeConfigValue `json:"fields"` 54 | } 55 | 56 | type ThemeConfigValue struct { 57 | Value interface{} `yaml:"value" json:"value"` 58 | } 59 | 60 | type ThemeUpdateRequest struct { 61 | Config map[string]ThemeConfigValue `json:"config"` 62 | } 63 | -------------------------------------------------------------------------------- /credentials.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "context" 5 | "golang.org/x/oauth2" 6 | "golang.org/x/oauth2/clientcredentials" 7 | ) 8 | 9 | type OAuthCredentials interface { 10 | GetTokenSource(ctx context.Context, tokenURL string) (oauth2.TokenSource, error) 11 | } 12 | 13 | type PasswordCredentials struct { 14 | Username string 15 | Password string 16 | Scopes []string 17 | } 18 | 19 | func NewPasswordCredentials(username, password string, scopes []string) PasswordCredentials { 20 | return PasswordCredentials{ 21 | Username: username, 22 | Password: password, 23 | Scopes: scopes, 24 | } 25 | } 26 | 27 | func (c PasswordCredentials) GetTokenSource(ctx context.Context, tokenURL string) (oauth2.TokenSource, error) { 28 | oauthConf := &oauth2.Config{ 29 | ClientID: "administration", 30 | Scopes: c.Scopes, 31 | Endpoint: oauth2.Endpoint{ 32 | TokenURL: tokenURL, 33 | }, 34 | } 35 | 36 | token, err := oauthConf.PasswordCredentialsToken(ctx, c.Username, c.Password) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return oauth2.StaticTokenSource(token), nil 41 | } 42 | 43 | type IntegrationCredentials struct { 44 | ClientId string 45 | ClientSecret string 46 | Scopes []string 47 | } 48 | 49 | func NewIntegrationCredentials(clientId, clientSecret string, scopes []string) IntegrationCredentials { 50 | return IntegrationCredentials{ 51 | ClientId: clientId, 52 | ClientSecret: clientSecret, 53 | Scopes: scopes, 54 | } 55 | } 56 | 57 | func (c IntegrationCredentials) GetTokenSource(ctx context.Context, tokenURL string) (oauth2.TokenSource, error) { 58 | oauthConf := &clientcredentials.Config{ 59 | ClientID: c.ClientId, 60 | ClientSecret: c.ClientSecret, 61 | Scopes: c.Scopes, 62 | TokenURL: tokenURL, 63 | } 64 | 65 | return oauthConf.TokenSource(ctx), nil 66 | } 67 | -------------------------------------------------------------------------------- /generator/generic_repo.tpl: -------------------------------------------------------------------------------- 1 | 2 | package go_shopware_admin_sdk 3 | 4 | import ( 5 | "fmt" 6 | "net/http" 7 | ) 8 | 9 | type Repository[T any, C any] struct { 10 | client *Client 11 | } 12 | 13 | func NewRepository[T any, C any](client *Client) *Repository[T, C] { 14 | return &Repository[T, C]{ 15 | client: client, 16 | } 17 | } 18 | 19 | func (r *Repository[T, C]) Search(ctx ApiContext, criteria Criteria, entityName string) (*C, *http.Response, error) { 20 | req, err := r.client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search/%s", entityName), criteria) 21 | if err != nil { 22 | return nil, nil, err 23 | } 24 | 25 | uResp := new(C) 26 | resp, err := r.client.Do(ctx.Context, req, uResp) 27 | if err != nil { 28 | return nil, resp, err 29 | } 30 | 31 | return uResp, resp, nil 32 | } 33 | 34 | func (r *Repository[T, C]) SearchIds(ctx ApiContext, criteria Criteria, entityName string) (*SearchIdsResponse, *http.Response, error) { 35 | req, err := r.client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search-ids/%s", entityName), criteria) 36 | if err != nil { 37 | return nil, nil, err 38 | } 39 | 40 | uResp := new(SearchIdsResponse) 41 | resp, err := r.client.Do(ctx.Context, req, uResp) 42 | if err != nil { 43 | return nil, resp, err 44 | } 45 | 46 | return uResp, resp, nil 47 | } 48 | 49 | func (r *Repository[T, C]) Upsert(ctx ApiContext, entity []T, entityName string) (*http.Response, error) { 50 | return r.client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 51 | Entity: entityName, 52 | Action: "upsert", 53 | Payload: entity, 54 | }}) 55 | } 56 | 57 | func (r *Repository[T, C]) Delete(ctx ApiContext, ids []string, entityName string) (*http.Response, error) { 58 | payload := make([]entityDelete, 0) 59 | 60 | for _, id := range ids { 61 | payload = append(payload, entityDelete{Id: id}) 62 | } 63 | 64 | return r.client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 65 | Entity: entityName, 66 | Action: "delete", 67 | Payload: payload, 68 | }}) 69 | } 70 | -------------------------------------------------------------------------------- /repository.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type GenericRepository[T any] struct { 9 | Client *Client 10 | } 11 | 12 | func NewGenericRepository[T any](client *Client) *GenericRepository[T] { 13 | return &GenericRepository[T]{ 14 | Client: client, 15 | } 16 | } 17 | 18 | func (r *GenericRepository[T]) Search(ctx ApiContext, criteria Criteria, entityName string) (*EntityCollection[T], *http.Response, error) { 19 | req, err := r.Client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search/%s", entityName), criteria) 20 | if err != nil { 21 | return nil, nil, err 22 | } 23 | 24 | uResp := new(EntityCollection[T]) 25 | resp, err := r.Client.Do(ctx.Context, req, uResp) 26 | if err != nil { 27 | return nil, resp, err 28 | } 29 | 30 | return uResp, resp, nil 31 | } 32 | 33 | func (r *GenericRepository[T]) SearchIds(ctx ApiContext, criteria Criteria, entityName string) (*SearchIdsResponse, *http.Response, error) { 34 | req, err := r.Client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search-ids/%s", entityName), criteria) 35 | if err != nil { 36 | return nil, nil, err 37 | } 38 | 39 | uResp := new(SearchIdsResponse) 40 | resp, err := r.Client.Do(ctx.Context, req, uResp) 41 | if err != nil { 42 | return nil, resp, err 43 | } 44 | 45 | return uResp, resp, nil 46 | } 47 | 48 | func (r *GenericRepository[T]) Upsert(ctx ApiContext, entity []T, entityName string) (*http.Response, error) { 49 | return r.Client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 50 | Entity: entityName, 51 | Action: "upsert", 52 | Payload: entity, 53 | }}) 54 | } 55 | 56 | func (r *GenericRepository[T]) Delete(ctx ApiContext, ids []string, entityName string) (*http.Response, error) { 57 | payload := make([]entityDelete, 0) 58 | 59 | for _, id := range ids { 60 | payload = append(payload, entityDelete{Id: id}) 61 | } 62 | 63 | return r.Client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 64 | Entity: entityName, 65 | Action: "delete", 66 | Payload: payload, 67 | }}) 68 | } 69 | -------------------------------------------------------------------------------- /generator/generic_repository.tpl: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type GenericRepository[T any, C any] struct { 9 | client *Client 10 | } 11 | 12 | func NewGenericRepository[T any, C any](client *Client) *GenericRepository[T, C] { 13 | return &GenericRepository[T, C]{ 14 | client: client, 15 | } 16 | } 17 | 18 | func (r *GenericRepository[T, C]) Search(ctx ApiContext, criteria Criteria, entityName string) (*C, *http.Response, error) { 19 | req, err := r.client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search/%s", entityName), criteria) 20 | if err != nil { 21 | return nil, nil, err 22 | } 23 | 24 | uResp := new(C) 25 | resp, err := r.client.Do(ctx.Context, req, uResp) 26 | if err != nil { 27 | return nil, resp, err 28 | } 29 | 30 | return uResp, resp, nil 31 | } 32 | 33 | func (r *GenericRepository[T, C]) SearchIds(ctx ApiContext, criteria Criteria, entityName string) (*SearchIdsResponse, *http.Response, error) { 34 | req, err := r.client.NewRequest(ctx, "POST", fmt.Sprintf("/api/search-ids/%s", entityName), criteria) 35 | if err != nil { 36 | return nil, nil, err 37 | } 38 | 39 | uResp := new(SearchIdsResponse) 40 | resp, err := r.client.Do(ctx.Context, req, uResp) 41 | if err != nil { 42 | return nil, resp, err 43 | } 44 | 45 | return uResp, resp, nil 46 | } 47 | 48 | func (r *GenericRepository[T, C]) Upsert(ctx ApiContext, entity []T, entityName string) (*http.Response, error) { 49 | return r.client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 50 | Entity: entityName, 51 | Action: "upsert", 52 | Payload: entity, 53 | }}) 54 | } 55 | 56 | func (r *GenericRepository[T, C]) Delete(ctx ApiContext, ids []string, entityName string) (*http.Response, error) { 57 | payload := make([]entityDelete, 0) 58 | 59 | for _, id := range ids { 60 | payload = append(payload, entityDelete{Id: id}) 61 | } 62 | 63 | return r.client.Bulk.Sync(ctx, map[string]SyncOperation{entityName: { 64 | Entity: entityName, 65 | Action: "delete", 66 | Payload: payload, 67 | }}) 68 | } 69 | -------------------------------------------------------------------------------- /repo_rule_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type RuleTagRepository struct { 9 | *GenericRepository[RuleTag] 10 | } 11 | 12 | func NewRuleTagRepository(client *Client) *RuleTagRepository { 13 | return &RuleTagRepository{ 14 | GenericRepository: NewGenericRepository[RuleTag](client), 15 | } 16 | } 17 | 18 | func (t *RuleTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[RuleTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "rule-tag") 20 | } 21 | 22 | func (t *RuleTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[RuleTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *RuleTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "rule-tag") 60 | } 61 | 62 | func (t *RuleTagRepository) Upsert(ctx ApiContext, entity []RuleTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "rule_tag") 64 | } 65 | 66 | func (t *RuleTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "rule_tag") 68 | } 69 | 70 | type RuleTag struct { 71 | 72 | Rule *Rule `json:"rule,omitempty"` 73 | 74 | RuleId string `json:"ruleId,omitempty"` 75 | 76 | Tag *Tag `json:"tag,omitempty"` 77 | 78 | TagId string `json:"tagId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_media_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type MediaTagRepository struct { 9 | *GenericRepository[MediaTag] 10 | } 11 | 12 | func NewMediaTagRepository(client *Client) *MediaTagRepository { 13 | return &MediaTagRepository{ 14 | GenericRepository: NewGenericRepository[MediaTag](client), 15 | } 16 | } 17 | 18 | func (t *MediaTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "media-tag") 20 | } 21 | 22 | func (t *MediaTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *MediaTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "media-tag") 60 | } 61 | 62 | func (t *MediaTagRepository) Upsert(ctx ApiContext, entity []MediaTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "media_tag") 64 | } 65 | 66 | func (t *MediaTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "media_tag") 68 | } 69 | 70 | type MediaTag struct { 71 | 72 | Media *Media `json:"media,omitempty"` 73 | 74 | MediaId string `json:"mediaId,omitempty"` 75 | 76 | Tag *Tag `json:"tag,omitempty"` 77 | 78 | TagId string `json:"tagId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_theme_media.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ThemeMediaRepository struct { 9 | *GenericRepository[ThemeMedia] 10 | } 11 | 12 | func NewThemeMediaRepository(client *Client) *ThemeMediaRepository { 13 | return &ThemeMediaRepository{ 14 | GenericRepository: NewGenericRepository[ThemeMedia](client), 15 | } 16 | } 17 | 18 | func (t *ThemeMediaRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeMedia], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "theme-media") 20 | } 21 | 22 | func (t *ThemeMediaRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeMedia], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ThemeMediaRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "theme-media") 60 | } 61 | 62 | func (t *ThemeMediaRepository) Upsert(ctx ApiContext, entity []ThemeMedia) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "theme_media") 64 | } 65 | 66 | func (t *ThemeMediaRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "theme_media") 68 | } 69 | 70 | type ThemeMedia struct { 71 | 72 | Media *Media `json:"media,omitempty"` 73 | 74 | MediaId string `json:"mediaId,omitempty"` 75 | 76 | Theme *Theme `json:"theme,omitempty"` 77 | 78 | ThemeId string `json:"themeId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_customer_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type CustomerTagRepository struct { 9 | *GenericRepository[CustomerTag] 10 | } 11 | 12 | func NewCustomerTagRepository(client *Client) *CustomerTagRepository { 13 | return &CustomerTagRepository{ 14 | GenericRepository: NewGenericRepository[CustomerTag](client), 15 | } 16 | } 17 | 18 | func (t *CustomerTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "customer-tag") 20 | } 21 | 22 | func (t *CustomerTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *CustomerTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "customer-tag") 60 | } 61 | 62 | func (t *CustomerTagRepository) Upsert(ctx ApiContext, entity []CustomerTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "customer_tag") 64 | } 65 | 66 | func (t *CustomerTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "customer_tag") 68 | } 69 | 70 | type CustomerTag struct { 71 | 72 | Customer *Customer `json:"customer,omitempty"` 73 | 74 | CustomerId string `json:"customerId,omitempty"` 75 | 76 | Tag *Tag `json:"tag,omitempty"` 77 | 78 | TagId string `json:"tagId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_order_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type OrderTagRepository struct { 9 | *GenericRepository[OrderTag] 10 | } 11 | 12 | func NewOrderTagRepository(client *Client) *OrderTagRepository { 13 | return &OrderTagRepository{ 14 | GenericRepository: NewGenericRepository[OrderTag](client), 15 | } 16 | } 17 | 18 | func (t *OrderTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[OrderTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "order-tag") 20 | } 21 | 22 | func (t *OrderTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[OrderTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *OrderTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "order-tag") 60 | } 61 | 62 | func (t *OrderTagRepository) Upsert(ctx ApiContext, entity []OrderTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "order_tag") 64 | } 65 | 66 | func (t *OrderTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "order_tag") 68 | } 69 | 70 | type OrderTag struct { 71 | 72 | Order *Order `json:"order,omitempty"` 73 | 74 | OrderId string `json:"orderId,omitempty"` 75 | 76 | OrderVersionId string `json:"orderVersionId,omitempty"` 77 | 78 | Tag *Tag `json:"tag,omitempty"` 79 | 80 | TagId string `json:"tagId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_theme_child.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ThemeChildRepository struct { 9 | *GenericRepository[ThemeChild] 10 | } 11 | 12 | func NewThemeChildRepository(client *Client) *ThemeChildRepository { 13 | return &ThemeChildRepository{ 14 | GenericRepository: NewGenericRepository[ThemeChild](client), 15 | } 16 | } 17 | 18 | func (t *ThemeChildRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeChild], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "theme-child") 20 | } 21 | 22 | func (t *ThemeChildRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeChild], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ThemeChildRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "theme-child") 60 | } 61 | 62 | func (t *ThemeChildRepository) Upsert(ctx ApiContext, entity []ThemeChild) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "theme_child") 64 | } 65 | 66 | func (t *ThemeChildRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "theme_child") 68 | } 69 | 70 | type ThemeChild struct { 71 | 72 | ChildId string `json:"childId,omitempty"` 73 | 74 | ChildTheme *Theme `json:"childTheme,omitempty"` 75 | 76 | ParentId string `json:"parentId,omitempty"` 77 | 78 | ParentTheme *Theme `json:"parentTheme,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_version.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type VersionRepository struct { 11 | *GenericRepository[Version] 12 | } 13 | 14 | func NewVersionRepository(client *Client) *VersionRepository { 15 | return &VersionRepository{ 16 | GenericRepository: NewGenericRepository[Version](client), 17 | } 18 | } 19 | 20 | func (t *VersionRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Version], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "version") 22 | } 23 | 24 | func (t *VersionRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Version], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *VersionRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "version") 62 | } 63 | 64 | func (t *VersionRepository) Upsert(ctx ApiContext, entity []Version) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "version") 66 | } 67 | 68 | func (t *VersionRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "version") 70 | } 71 | 72 | type Version struct { 73 | 74 | Commits []VersionCommit `json:"commits,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | Name string `json:"name,omitempty"` 81 | 82 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 83 | 84 | } 85 | -------------------------------------------------------------------------------- /generator/entity_repo.tpl: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | {{if .HasTimeField}} 6 | "time" 7 | {{end}} 8 | ) 9 | 10 | type {{ .FormattedName }}Repository struct { 11 | *GenericRepository[{{ .FormattedName }}] 12 | } 13 | 14 | func New{{ .FormattedName }}Repository(client *Client) *{{ .FormattedName }}Repository { 15 | return &{{ .FormattedName }}Repository{ 16 | GenericRepository: NewGenericRepository[{{ .FormattedName }}](client), 17 | } 18 | } 19 | 20 | func (t *{{ .FormattedName }}Repository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[{{ .FormattedName }}], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "{{ .ApiPath }}") 22 | } 23 | 24 | func (t *{{ .FormattedName }}Repository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[{{ .FormattedName }}], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *{{ .FormattedName }}Repository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "{{ .ApiPath }}") 62 | } 63 | 64 | func (t *{{ .FormattedName }}Repository) Upsert(ctx ApiContext, entity []{{ .FormattedName }}) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "{{ .Name }}") 66 | } 67 | 68 | func (t *{{ .FormattedName }}Repository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "{{ .Name }}") 70 | } 71 | 72 | type {{ .FormattedName }} struct { 73 | {{ range .Fields }} 74 | {{ .Key }} {{ .Type }} `json:"{{ .Name }},omitempty"` 75 | {{ end }} 76 | } 77 | -------------------------------------------------------------------------------- /repo_product_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductTagRepository struct { 9 | *GenericRepository[ProductTag] 10 | } 11 | 12 | func NewProductTagRepository(client *Client) *ProductTagRepository { 13 | return &ProductTagRepository{ 14 | GenericRepository: NewGenericRepository[ProductTag](client), 15 | } 16 | } 17 | 18 | func (t *ProductTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-tag") 20 | } 21 | 22 | func (t *ProductTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-tag") 60 | } 61 | 62 | func (t *ProductTagRepository) Upsert(ctx ApiContext, entity []ProductTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_tag") 64 | } 65 | 66 | func (t *ProductTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_tag") 68 | } 69 | 70 | type ProductTag struct { 71 | 72 | Product *Product `json:"product,omitempty"` 73 | 74 | ProductId string `json:"productId,omitempty"` 75 | 76 | ProductVersionId string `json:"productVersionId,omitempty"` 77 | 78 | Tag *Tag `json:"tag,omitempty"` 79 | 80 | TagId string `json:"tagId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_category_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type CategoryTagRepository struct { 9 | *GenericRepository[CategoryTag] 10 | } 11 | 12 | func NewCategoryTagRepository(client *Client) *CategoryTagRepository { 13 | return &CategoryTagRepository{ 14 | GenericRepository: NewGenericRepository[CategoryTag](client), 15 | } 16 | } 17 | 18 | func (t *CategoryTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CategoryTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "category-tag") 20 | } 21 | 22 | func (t *CategoryTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CategoryTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *CategoryTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "category-tag") 60 | } 61 | 62 | func (t *CategoryTagRepository) Upsert(ctx ApiContext, entity []CategoryTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "category_tag") 64 | } 65 | 66 | func (t *CategoryTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "category_tag") 68 | } 69 | 70 | type CategoryTag struct { 71 | 72 | Category *Category `json:"category,omitempty"` 73 | 74 | CategoryId string `json:"categoryId,omitempty"` 75 | 76 | CategoryVersionId string `json:"categoryVersionId,omitempty"` 77 | 78 | Tag *Tag `json:"tag,omitempty"` 79 | 80 | TagId string `json:"tagId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_flow_template.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type FlowTemplateRepository struct { 11 | *GenericRepository[FlowTemplate] 12 | } 13 | 14 | func NewFlowTemplateRepository(client *Client) *FlowTemplateRepository { 15 | return &FlowTemplateRepository{ 16 | GenericRepository: NewGenericRepository[FlowTemplate](client), 17 | } 18 | } 19 | 20 | func (t *FlowTemplateRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[FlowTemplate], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "flow-template") 22 | } 23 | 24 | func (t *FlowTemplateRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[FlowTemplate], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *FlowTemplateRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "flow-template") 62 | } 63 | 64 | func (t *FlowTemplateRepository) Upsert(ctx ApiContext, entity []FlowTemplate) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "flow_template") 66 | } 67 | 68 | func (t *FlowTemplateRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "flow_template") 70 | } 71 | 72 | type FlowTemplate struct { 73 | 74 | Config interface{} `json:"config,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | Name string `json:"name,omitempty"` 81 | 82 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 83 | 84 | } 85 | -------------------------------------------------------------------------------- /repo_integration_role.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type IntegrationRoleRepository struct { 9 | *GenericRepository[IntegrationRole] 10 | } 11 | 12 | func NewIntegrationRoleRepository(client *Client) *IntegrationRoleRepository { 13 | return &IntegrationRoleRepository{ 14 | GenericRepository: NewGenericRepository[IntegrationRole](client), 15 | } 16 | } 17 | 18 | func (t *IntegrationRoleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[IntegrationRole], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "integration-role") 20 | } 21 | 22 | func (t *IntegrationRoleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[IntegrationRole], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *IntegrationRoleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "integration-role") 60 | } 61 | 62 | func (t *IntegrationRoleRepository) Upsert(ctx ApiContext, entity []IntegrationRole) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "integration_role") 64 | } 65 | 66 | func (t *IntegrationRoleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "integration_role") 68 | } 69 | 70 | type IntegrationRole struct { 71 | 72 | AclRoleId string `json:"aclRoleId,omitempty"` 73 | 74 | Integration *Integration `json:"integration,omitempty"` 75 | 76 | IntegrationId string `json:"integrationId,omitempty"` 77 | 78 | Role *AclRole `json:"role,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_promotion_cart_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionCartRuleRepository struct { 9 | *GenericRepository[PromotionCartRule] 10 | } 11 | 12 | func NewPromotionCartRuleRepository(client *Client) *PromotionCartRuleRepository { 13 | return &PromotionCartRuleRepository{ 14 | GenericRepository: NewGenericRepository[PromotionCartRule](client), 15 | } 16 | } 17 | 18 | func (t *PromotionCartRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionCartRule], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-cart-rule") 20 | } 21 | 22 | func (t *PromotionCartRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionCartRule], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionCartRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-cart-rule") 60 | } 61 | 62 | func (t *PromotionCartRuleRepository) Upsert(ctx ApiContext, entity []PromotionCartRule) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_cart_rule") 64 | } 65 | 66 | func (t *PromotionCartRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_cart_rule") 68 | } 69 | 70 | type PromotionCartRule struct { 71 | 72 | Promotion *Promotion `json:"promotion,omitempty"` 73 | 74 | PromotionId string `json:"promotionId,omitempty"` 75 | 76 | Rule *Rule `json:"rule,omitempty"` 77 | 78 | RuleId string `json:"ruleId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_product_option.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductOptionRepository struct { 9 | *GenericRepository[ProductOption] 10 | } 11 | 12 | func NewProductOptionRepository(client *Client) *ProductOptionRepository { 13 | return &ProductOptionRepository{ 14 | GenericRepository: NewGenericRepository[ProductOption](client), 15 | } 16 | } 17 | 18 | func (t *ProductOptionRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductOption], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-option") 20 | } 21 | 22 | func (t *ProductOptionRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductOption], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductOptionRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-option") 60 | } 61 | 62 | func (t *ProductOptionRepository) Upsert(ctx ApiContext, entity []ProductOption) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_option") 64 | } 65 | 66 | func (t *ProductOptionRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_option") 68 | } 69 | 70 | type ProductOption struct { 71 | 72 | Option *PropertyGroupOption `json:"option,omitempty"` 73 | 74 | OptionId string `json:"optionId,omitempty"` 75 | 76 | Product *Product `json:"product,omitempty"` 77 | 78 | ProductId string `json:"productId,omitempty"` 79 | 80 | ProductVersionId string `json:"productVersionId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_user_recovery.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type UserRecoveryRepository struct { 11 | *GenericRepository[UserRecovery] 12 | } 13 | 14 | func NewUserRecoveryRepository(client *Client) *UserRecoveryRepository { 15 | return &UserRecoveryRepository{ 16 | GenericRepository: NewGenericRepository[UserRecovery](client), 17 | } 18 | } 19 | 20 | func (t *UserRecoveryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[UserRecovery], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "user-recovery") 22 | } 23 | 24 | func (t *UserRecoveryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[UserRecovery], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *UserRecoveryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "user-recovery") 62 | } 63 | 64 | func (t *UserRecoveryRepository) Upsert(ctx ApiContext, entity []UserRecovery) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "user_recovery") 66 | } 67 | 68 | func (t *UserRecoveryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "user_recovery") 70 | } 71 | 72 | type UserRecovery struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Hash string `json:"hash,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 81 | 82 | User *User `json:"user,omitempty"` 83 | 84 | UserId string `json:"userId,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_acl_user_role.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AclUserRoleRepository struct { 11 | *GenericRepository[AclUserRole] 12 | } 13 | 14 | func NewAclUserRoleRepository(client *Client) *AclUserRoleRepository { 15 | return &AclUserRoleRepository{ 16 | GenericRepository: NewGenericRepository[AclUserRole](client), 17 | } 18 | } 19 | 20 | func (t *AclUserRoleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AclUserRole], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "acl-user-role") 22 | } 23 | 24 | func (t *AclUserRoleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AclUserRole], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AclUserRoleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "acl-user-role") 62 | } 63 | 64 | func (t *AclUserRoleRepository) Upsert(ctx ApiContext, entity []AclUserRole) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "acl_user_role") 66 | } 67 | 68 | func (t *AclUserRoleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "acl_user_role") 70 | } 71 | 72 | type AclUserRole struct { 73 | 74 | AclRole *AclRole `json:"aclRole,omitempty"` 75 | 76 | AclRoleId string `json:"aclRoleId,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 81 | 82 | User *User `json:"user,omitempty"` 83 | 84 | UserId string `json:"userId,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_promotion_order_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionOrderRuleRepository struct { 9 | *GenericRepository[PromotionOrderRule] 10 | } 11 | 12 | func NewPromotionOrderRuleRepository(client *Client) *PromotionOrderRuleRepository { 13 | return &PromotionOrderRuleRepository{ 14 | GenericRepository: NewGenericRepository[PromotionOrderRule](client), 15 | } 16 | } 17 | 18 | func (t *PromotionOrderRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionOrderRule], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-order-rule") 20 | } 21 | 22 | func (t *PromotionOrderRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionOrderRule], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionOrderRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-order-rule") 60 | } 61 | 62 | func (t *PromotionOrderRuleRepository) Upsert(ctx ApiContext, entity []PromotionOrderRule) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_order_rule") 64 | } 65 | 66 | func (t *PromotionOrderRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_order_rule") 68 | } 69 | 70 | type PromotionOrderRule struct { 71 | 72 | Promotion *Promotion `json:"promotion,omitempty"` 73 | 74 | PromotionId string `json:"promotionId,omitempty"` 75 | 76 | Rule *Rule `json:"rule,omitempty"` 77 | 78 | RuleId string `json:"ruleId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_shipping_method_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ShippingMethodTagRepository struct { 9 | *GenericRepository[ShippingMethodTag] 10 | } 11 | 12 | func NewShippingMethodTagRepository(client *Client) *ShippingMethodTagRepository { 13 | return &ShippingMethodTagRepository{ 14 | GenericRepository: NewGenericRepository[ShippingMethodTag](client), 15 | } 16 | } 17 | 18 | func (t *ShippingMethodTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ShippingMethodTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "shipping-method-tag") 20 | } 21 | 22 | func (t *ShippingMethodTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ShippingMethodTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ShippingMethodTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "shipping-method-tag") 60 | } 61 | 62 | func (t *ShippingMethodTagRepository) Upsert(ctx ApiContext, entity []ShippingMethodTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "shipping_method_tag") 64 | } 65 | 66 | func (t *ShippingMethodTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "shipping_method_tag") 68 | } 69 | 70 | type ShippingMethodTag struct { 71 | 72 | ShippingMethod *ShippingMethod `json:"shippingMethod,omitempty"` 73 | 74 | ShippingMethodId string `json:"shippingMethodId,omitempty"` 75 | 76 | Tag *Tag `json:"tag,omitempty"` 77 | 78 | TagId string `json:"tagId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_theme_sales_channel.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ThemeSalesChannelRepository struct { 9 | *GenericRepository[ThemeSalesChannel] 10 | } 11 | 12 | func NewThemeSalesChannelRepository(client *Client) *ThemeSalesChannelRepository { 13 | return &ThemeSalesChannelRepository{ 14 | GenericRepository: NewGenericRepository[ThemeSalesChannel](client), 15 | } 16 | } 17 | 18 | func (t *ThemeSalesChannelRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeSalesChannel], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "theme-sales-channel") 20 | } 21 | 22 | func (t *ThemeSalesChannelRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ThemeSalesChannel], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ThemeSalesChannelRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "theme-sales-channel") 60 | } 61 | 62 | func (t *ThemeSalesChannelRepository) Upsert(ctx ApiContext, entity []ThemeSalesChannel) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "theme_sales_channel") 64 | } 65 | 66 | func (t *ThemeSalesChannelRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "theme_sales_channel") 68 | } 69 | 70 | type ThemeSalesChannel struct { 71 | 72 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 73 | 74 | SalesChannelId string `json:"salesChannelId,omitempty"` 75 | 76 | Theme *Theme `json:"theme,omitempty"` 77 | 78 | ThemeId string `json:"themeId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_landing_page_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type LandingPageTagRepository struct { 9 | *GenericRepository[LandingPageTag] 10 | } 11 | 12 | func NewLandingPageTagRepository(client *Client) *LandingPageTagRepository { 13 | return &LandingPageTagRepository{ 14 | GenericRepository: NewGenericRepository[LandingPageTag](client), 15 | } 16 | } 17 | 18 | func (t *LandingPageTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[LandingPageTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "landing-page-tag") 20 | } 21 | 22 | func (t *LandingPageTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[LandingPageTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *LandingPageTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "landing-page-tag") 60 | } 61 | 62 | func (t *LandingPageTagRepository) Upsert(ctx ApiContext, entity []LandingPageTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "landing_page_tag") 64 | } 65 | 66 | func (t *LandingPageTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "landing_page_tag") 68 | } 69 | 70 | type LandingPageTag struct { 71 | 72 | LandingPage *LandingPage `json:"landingPage,omitempty"` 73 | 74 | LandingPageId string `json:"landingPageId,omitempty"` 75 | 76 | LandingPageVersionId string `json:"landingPageVersionId,omitempty"` 77 | 78 | Tag *Tag `json:"tag,omitempty"` 79 | 80 | TagId string `json:"tagId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_user_config.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type UserConfigRepository struct { 11 | *GenericRepository[UserConfig] 12 | } 13 | 14 | func NewUserConfigRepository(client *Client) *UserConfigRepository { 15 | return &UserConfigRepository{ 16 | GenericRepository: NewGenericRepository[UserConfig](client), 17 | } 18 | } 19 | 20 | func (t *UserConfigRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[UserConfig], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "user-config") 22 | } 23 | 24 | func (t *UserConfigRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[UserConfig], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *UserConfigRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "user-config") 62 | } 63 | 64 | func (t *UserConfigRepository) Upsert(ctx ApiContext, entity []UserConfig) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "user_config") 66 | } 67 | 68 | func (t *UserConfigRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "user_config") 70 | } 71 | 72 | type UserConfig struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | Key string `json:"key,omitempty"` 79 | 80 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 81 | 82 | User *User `json:"user,omitempty"` 83 | 84 | UserId string `json:"userId,omitempty"` 85 | 86 | Value interface{} `json:"value,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_product_property.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductPropertyRepository struct { 9 | *GenericRepository[ProductProperty] 10 | } 11 | 12 | func NewProductPropertyRepository(client *Client) *ProductPropertyRepository { 13 | return &ProductPropertyRepository{ 14 | GenericRepository: NewGenericRepository[ProductProperty](client), 15 | } 16 | } 17 | 18 | func (t *ProductPropertyRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductProperty], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-property") 20 | } 21 | 22 | func (t *ProductPropertyRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductProperty], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductPropertyRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-property") 60 | } 61 | 62 | func (t *ProductPropertyRepository) Upsert(ctx ApiContext, entity []ProductProperty) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_property") 64 | } 65 | 66 | func (t *ProductPropertyRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_property") 68 | } 69 | 70 | type ProductProperty struct { 71 | 72 | Option *PropertyGroupOption `json:"option,omitempty"` 73 | 74 | OptionId string `json:"optionId,omitempty"` 75 | 76 | Product *Product `json:"product,omitempty"` 77 | 78 | ProductId string `json:"productId,omitempty"` 79 | 80 | ProductVersionId string `json:"productVersionId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_script.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type ScriptRepository struct { 11 | *GenericRepository[Script] 12 | } 13 | 14 | func NewScriptRepository(client *Client) *ScriptRepository { 15 | return &ScriptRepository{ 16 | GenericRepository: NewGenericRepository[Script](client), 17 | } 18 | } 19 | 20 | func (t *ScriptRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Script], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "script") 22 | } 23 | 24 | func (t *ScriptRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Script], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *ScriptRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "script") 62 | } 63 | 64 | func (t *ScriptRepository) Upsert(ctx ApiContext, entity []Script) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "script") 66 | } 67 | 68 | func (t *ScriptRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "script") 70 | } 71 | 72 | type Script struct { 73 | 74 | Active bool `json:"active,omitempty"` 75 | 76 | App *App `json:"app,omitempty"` 77 | 78 | AppId string `json:"appId,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | Hook string `json:"hook,omitempty"` 83 | 84 | Id string `json:"id,omitempty"` 85 | 86 | Name string `json:"name,omitempty"` 87 | 88 | Script string `json:"script,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_promotion_persona_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionPersonaRuleRepository struct { 9 | *GenericRepository[PromotionPersonaRule] 10 | } 11 | 12 | func NewPromotionPersonaRuleRepository(client *Client) *PromotionPersonaRuleRepository { 13 | return &PromotionPersonaRuleRepository{ 14 | GenericRepository: NewGenericRepository[PromotionPersonaRule](client), 15 | } 16 | } 17 | 18 | func (t *PromotionPersonaRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionPersonaRule], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-persona-rule") 20 | } 21 | 22 | func (t *PromotionPersonaRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionPersonaRule], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionPersonaRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-persona-rule") 60 | } 61 | 62 | func (t *PromotionPersonaRuleRepository) Upsert(ctx ApiContext, entity []PromotionPersonaRule) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_persona_rule") 64 | } 65 | 66 | func (t *PromotionPersonaRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_persona_rule") 68 | } 69 | 70 | type PromotionPersonaRule struct { 71 | 72 | Promotion *Promotion `json:"promotion,omitempty"` 73 | 74 | PromotionId string `json:"promotionId,omitempty"` 75 | 76 | Rule *Rule `json:"rule,omitempty"` 77 | 78 | RuleId string `json:"ruleId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_sales_channel_country.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type SalesChannelCountryRepository struct { 9 | *GenericRepository[SalesChannelCountry] 10 | } 11 | 12 | func NewSalesChannelCountryRepository(client *Client) *SalesChannelCountryRepository { 13 | return &SalesChannelCountryRepository{ 14 | GenericRepository: NewGenericRepository[SalesChannelCountry](client), 15 | } 16 | } 17 | 18 | func (t *SalesChannelCountryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelCountry], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-country") 20 | } 21 | 22 | func (t *SalesChannelCountryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelCountry], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *SalesChannelCountryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-country") 60 | } 61 | 62 | func (t *SalesChannelCountryRepository) Upsert(ctx ApiContext, entity []SalesChannelCountry) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_country") 64 | } 65 | 66 | func (t *SalesChannelCountryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_country") 68 | } 69 | 70 | type SalesChannelCountry struct { 71 | 72 | Country *Country `json:"country,omitempty"` 73 | 74 | CountryId string `json:"countryId,omitempty"` 75 | 76 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 77 | 78 | SalesChannelId string `json:"salesChannelId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_log_entry.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type LogEntryRepository struct { 11 | *GenericRepository[LogEntry] 12 | } 13 | 14 | func NewLogEntryRepository(client *Client) *LogEntryRepository { 15 | return &LogEntryRepository{ 16 | GenericRepository: NewGenericRepository[LogEntry](client), 17 | } 18 | } 19 | 20 | func (t *LogEntryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[LogEntry], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "log-entry") 22 | } 23 | 24 | func (t *LogEntryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[LogEntry], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *LogEntryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "log-entry") 62 | } 63 | 64 | func (t *LogEntryRepository) Upsert(ctx ApiContext, entity []LogEntry) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "log_entry") 66 | } 67 | 68 | func (t *LogEntryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "log_entry") 70 | } 71 | 72 | type LogEntry struct { 73 | 74 | Channel string `json:"channel,omitempty"` 75 | 76 | Context interface{} `json:"context,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | Extra interface{} `json:"extra,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | Level float64 `json:"level,omitempty"` 85 | 86 | Message string `json:"message,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | } 91 | -------------------------------------------------------------------------------- /repo_promotion_discount_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionDiscountRuleRepository struct { 9 | *GenericRepository[PromotionDiscountRule] 10 | } 11 | 12 | func NewPromotionDiscountRuleRepository(client *Client) *PromotionDiscountRuleRepository { 13 | return &PromotionDiscountRuleRepository{ 14 | GenericRepository: NewGenericRepository[PromotionDiscountRule](client), 15 | } 16 | } 17 | 18 | func (t *PromotionDiscountRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionDiscountRule], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-discount-rule") 20 | } 21 | 22 | func (t *PromotionDiscountRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionDiscountRule], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionDiscountRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-discount-rule") 60 | } 61 | 62 | func (t *PromotionDiscountRuleRepository) Upsert(ctx ApiContext, entity []PromotionDiscountRule) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_discount_rule") 64 | } 65 | 66 | func (t *PromotionDiscountRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_discount_rule") 68 | } 69 | 70 | type PromotionDiscountRule struct { 71 | 72 | Discount *PromotionDiscount `json:"discount,omitempty"` 73 | 74 | DiscountId string `json:"discountId,omitempty"` 75 | 76 | Rule *Rule `json:"rule,omitempty"` 77 | 78 | RuleId string `json:"ruleId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_promotion_setgroup_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionSetgroupRuleRepository struct { 9 | *GenericRepository[PromotionSetgroupRule] 10 | } 11 | 12 | func NewPromotionSetgroupRuleRepository(client *Client) *PromotionSetgroupRuleRepository { 13 | return &PromotionSetgroupRuleRepository{ 14 | GenericRepository: NewGenericRepository[PromotionSetgroupRule](client), 15 | } 16 | } 17 | 18 | func (t *PromotionSetgroupRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSetgroupRule], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-setgroup-rule") 20 | } 21 | 22 | func (t *PromotionSetgroupRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSetgroupRule], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionSetgroupRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-setgroup-rule") 60 | } 61 | 62 | func (t *PromotionSetgroupRuleRepository) Upsert(ctx ApiContext, entity []PromotionSetgroupRule) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_setgroup_rule") 64 | } 65 | 66 | func (t *PromotionSetgroupRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_setgroup_rule") 68 | } 69 | 70 | type PromotionSetgroupRule struct { 71 | 72 | Rule *Rule `json:"rule,omitempty"` 73 | 74 | RuleId string `json:"ruleId,omitempty"` 75 | 76 | Setgroup *PromotionSetgroup `json:"setgroup,omitempty"` 77 | 78 | SetgroupId string `json:"setgroupId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_sales_channel_currency.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type SalesChannelCurrencyRepository struct { 9 | *GenericRepository[SalesChannelCurrency] 10 | } 11 | 12 | func NewSalesChannelCurrencyRepository(client *Client) *SalesChannelCurrencyRepository { 13 | return &SalesChannelCurrencyRepository{ 14 | GenericRepository: NewGenericRepository[SalesChannelCurrency](client), 15 | } 16 | } 17 | 18 | func (t *SalesChannelCurrencyRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelCurrency], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-currency") 20 | } 21 | 22 | func (t *SalesChannelCurrencyRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelCurrency], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *SalesChannelCurrencyRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-currency") 60 | } 61 | 62 | func (t *SalesChannelCurrencyRepository) Upsert(ctx ApiContext, entity []SalesChannelCurrency) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_currency") 64 | } 65 | 66 | func (t *SalesChannelCurrencyRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_currency") 68 | } 69 | 70 | type SalesChannelCurrency struct { 71 | 72 | Currency *Currency `json:"currency,omitempty"` 73 | 74 | CurrencyId string `json:"currencyId,omitempty"` 75 | 76 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 77 | 78 | SalesChannelId string `json:"salesChannelId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_sales_channel_language.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type SalesChannelLanguageRepository struct { 9 | *GenericRepository[SalesChannelLanguage] 10 | } 11 | 12 | func NewSalesChannelLanguageRepository(client *Client) *SalesChannelLanguageRepository { 13 | return &SalesChannelLanguageRepository{ 14 | GenericRepository: NewGenericRepository[SalesChannelLanguage](client), 15 | } 16 | } 17 | 18 | func (t *SalesChannelLanguageRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelLanguage], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-language") 20 | } 21 | 22 | func (t *SalesChannelLanguageRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelLanguage], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *SalesChannelLanguageRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-language") 60 | } 61 | 62 | func (t *SalesChannelLanguageRepository) Upsert(ctx ApiContext, entity []SalesChannelLanguage) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_language") 64 | } 65 | 66 | func (t *SalesChannelLanguageRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_language") 68 | } 69 | 70 | type SalesChannelLanguage struct { 71 | 72 | Language *Language `json:"language,omitempty"` 73 | 74 | LanguageId string `json:"languageId,omitempty"` 75 | 76 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 77 | 78 | SalesChannelId string `json:"salesChannelId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_unit.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type UnitRepository struct { 11 | *GenericRepository[Unit] 12 | } 13 | 14 | func NewUnitRepository(client *Client) *UnitRepository { 15 | return &UnitRepository{ 16 | GenericRepository: NewGenericRepository[Unit](client), 17 | } 18 | } 19 | 20 | func (t *UnitRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Unit], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "unit") 22 | } 23 | 24 | func (t *UnitRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Unit], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *UnitRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "unit") 62 | } 63 | 64 | func (t *UnitRepository) Upsert(ctx ApiContext, entity []Unit) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "unit") 66 | } 67 | 68 | func (t *UnitRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "unit") 70 | } 71 | 72 | type Unit struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | Name string `json:"name,omitempty"` 81 | 82 | Products []Product `json:"products,omitempty"` 83 | 84 | ShortCode string `json:"shortCode,omitempty"` 85 | 86 | Translated interface{} `json:"translated,omitempty"` 87 | 88 | Translations []UnitTranslation `json:"translations,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_customer_recovery.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type CustomerRecoveryRepository struct { 11 | *GenericRepository[CustomerRecovery] 12 | } 13 | 14 | func NewCustomerRecoveryRepository(client *Client) *CustomerRecoveryRepository { 15 | return &CustomerRecoveryRepository{ 16 | GenericRepository: NewGenericRepository[CustomerRecovery](client), 17 | } 18 | } 19 | 20 | func (t *CustomerRecoveryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerRecovery], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "customer-recovery") 22 | } 23 | 24 | func (t *CustomerRecoveryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerRecovery], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *CustomerRecoveryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "customer-recovery") 62 | } 63 | 64 | func (t *CustomerRecoveryRepository) Upsert(ctx ApiContext, entity []CustomerRecovery) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "customer_recovery") 66 | } 67 | 68 | func (t *CustomerRecoveryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "customer_recovery") 70 | } 71 | 72 | type CustomerRecovery struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Customer *Customer `json:"customer,omitempty"` 77 | 78 | CustomerId string `json:"customerId,omitempty"` 79 | 80 | Hash string `json:"hash,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_product_category.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductCategoryRepository struct { 9 | *GenericRepository[ProductCategory] 10 | } 11 | 12 | func NewProductCategoryRepository(client *Client) *ProductCategoryRepository { 13 | return &ProductCategoryRepository{ 14 | GenericRepository: NewGenericRepository[ProductCategory](client), 15 | } 16 | } 17 | 18 | func (t *ProductCategoryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCategory], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-category") 20 | } 21 | 22 | func (t *ProductCategoryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCategory], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductCategoryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-category") 60 | } 61 | 62 | func (t *ProductCategoryRepository) Upsert(ctx ApiContext, entity []ProductCategory) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_category") 64 | } 65 | 66 | func (t *ProductCategoryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_category") 68 | } 69 | 70 | type ProductCategory struct { 71 | 72 | Category *Category `json:"category,omitempty"` 73 | 74 | CategoryId string `json:"categoryId,omitempty"` 75 | 76 | CategoryVersionId string `json:"categoryVersionId,omitempty"` 77 | 78 | Product *Product `json:"product,omitempty"` 79 | 80 | ProductId string `json:"productId,omitempty"` 81 | 82 | ProductVersionId string `json:"productVersionId,omitempty"` 83 | 84 | } 85 | -------------------------------------------------------------------------------- /repo_snippet.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type SnippetRepository struct { 11 | *GenericRepository[Snippet] 12 | } 13 | 14 | func NewSnippetRepository(client *Client) *SnippetRepository { 15 | return &SnippetRepository{ 16 | GenericRepository: NewGenericRepository[Snippet](client), 17 | } 18 | } 19 | 20 | func (t *SnippetRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Snippet], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "snippet") 22 | } 23 | 24 | func (t *SnippetRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Snippet], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *SnippetRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "snippet") 62 | } 63 | 64 | func (t *SnippetRepository) Upsert(ctx ApiContext, entity []Snippet) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "snippet") 66 | } 67 | 68 | func (t *SnippetRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "snippet") 70 | } 71 | 72 | type Snippet struct { 73 | 74 | Author string `json:"author,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | CustomFields interface{} `json:"customFields,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Set *SnippetSet `json:"set,omitempty"` 83 | 84 | SetId string `json:"setId,omitempty"` 85 | 86 | TranslationKey string `json:"translationKey,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | Value string `json:"value,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_tax.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type TaxRepository struct { 11 | *GenericRepository[Tax] 12 | } 13 | 14 | func NewTaxRepository(client *Client) *TaxRepository { 15 | return &TaxRepository{ 16 | GenericRepository: NewGenericRepository[Tax](client), 17 | } 18 | } 19 | 20 | func (t *TaxRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Tax], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "tax") 22 | } 23 | 24 | func (t *TaxRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Tax], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *TaxRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "tax") 62 | } 63 | 64 | func (t *TaxRepository) Upsert(ctx ApiContext, entity []Tax) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "tax") 66 | } 67 | 68 | func (t *TaxRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "tax") 70 | } 71 | 72 | type Tax struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | Name string `json:"name,omitempty"` 81 | 82 | Position float64 `json:"position,omitempty"` 83 | 84 | Products []Product `json:"products,omitempty"` 85 | 86 | Rules []TaxRule `json:"rules,omitempty"` 87 | 88 | ShippingMethods []ShippingMethod `json:"shippingMethods,omitempty"` 89 | 90 | TaxRate float64 `json:"taxRate,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_newsletter_recipient_tag.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type NewsletterRecipientTagRepository struct { 9 | *GenericRepository[NewsletterRecipientTag] 10 | } 11 | 12 | func NewNewsletterRecipientTagRepository(client *Client) *NewsletterRecipientTagRepository { 13 | return &NewsletterRecipientTagRepository{ 14 | GenericRepository: NewGenericRepository[NewsletterRecipientTag](client), 15 | } 16 | } 17 | 18 | func (t *NewsletterRecipientTagRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[NewsletterRecipientTag], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "newsletter-recipient-tag") 20 | } 21 | 22 | func (t *NewsletterRecipientTagRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[NewsletterRecipientTag], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *NewsletterRecipientTagRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "newsletter-recipient-tag") 60 | } 61 | 62 | func (t *NewsletterRecipientTagRepository) Upsert(ctx ApiContext, entity []NewsletterRecipientTag) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "newsletter_recipient_tag") 64 | } 65 | 66 | func (t *NewsletterRecipientTagRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "newsletter_recipient_tag") 68 | } 69 | 70 | type NewsletterRecipientTag struct { 71 | 72 | NewsletterRecipient *NewsletterRecipient `json:"newsletterRecipient,omitempty"` 73 | 74 | NewsletterRecipientId string `json:"newsletterRecipientId,omitempty"` 75 | 76 | Tag *Tag `json:"tag,omitempty"` 77 | 78 | TagId string `json:"tagId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_number_range_state.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type NumberRangeStateRepository struct { 11 | *GenericRepository[NumberRangeState] 12 | } 13 | 14 | func NewNumberRangeStateRepository(client *Client) *NumberRangeStateRepository { 15 | return &NumberRangeStateRepository{ 16 | GenericRepository: NewGenericRepository[NumberRangeState](client), 17 | } 18 | } 19 | 20 | func (t *NumberRangeStateRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[NumberRangeState], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "number-range-state") 22 | } 23 | 24 | func (t *NumberRangeStateRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[NumberRangeState], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *NumberRangeStateRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "number-range-state") 62 | } 63 | 64 | func (t *NumberRangeStateRepository) Upsert(ctx ApiContext, entity []NumberRangeState) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "number_range_state") 66 | } 67 | 68 | func (t *NumberRangeStateRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "number_range_state") 70 | } 71 | 72 | type NumberRangeState struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | LastValue float64 `json:"lastValue,omitempty"` 79 | 80 | NumberRange *NumberRange `json:"numberRange,omitempty"` 81 | 82 | NumberRangeId string `json:"numberRangeId,omitempty"` 83 | 84 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_app_template.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppTemplateRepository struct { 11 | *GenericRepository[AppTemplate] 12 | } 13 | 14 | func NewAppTemplateRepository(client *Client) *AppTemplateRepository { 15 | return &AppTemplateRepository{ 16 | GenericRepository: NewGenericRepository[AppTemplate](client), 17 | } 18 | } 19 | 20 | func (t *AppTemplateRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppTemplate], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-template") 22 | } 23 | 24 | func (t *AppTemplateRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppTemplate], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppTemplateRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-template") 62 | } 63 | 64 | func (t *AppTemplateRepository) Upsert(ctx ApiContext, entity []AppTemplate) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_template") 66 | } 67 | 68 | func (t *AppTemplateRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_template") 70 | } 71 | 72 | type AppTemplate struct { 73 | 74 | Active bool `json:"active,omitempty"` 75 | 76 | App *App `json:"app,omitempty"` 77 | 78 | AppId string `json:"appId,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | Hash string `json:"hash,omitempty"` 83 | 84 | Id string `json:"id,omitempty"` 85 | 86 | Path string `json:"path,omitempty"` 87 | 88 | Template string `json:"template,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_promotion_persona_customer.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type PromotionPersonaCustomerRepository struct { 9 | *GenericRepository[PromotionPersonaCustomer] 10 | } 11 | 12 | func NewPromotionPersonaCustomerRepository(client *Client) *PromotionPersonaCustomerRepository { 13 | return &PromotionPersonaCustomerRepository{ 14 | GenericRepository: NewGenericRepository[PromotionPersonaCustomer](client), 15 | } 16 | } 17 | 18 | func (t *PromotionPersonaCustomerRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionPersonaCustomer], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "promotion-persona-customer") 20 | } 21 | 22 | func (t *PromotionPersonaCustomerRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionPersonaCustomer], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *PromotionPersonaCustomerRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-persona-customer") 60 | } 61 | 62 | func (t *PromotionPersonaCustomerRepository) Upsert(ctx ApiContext, entity []PromotionPersonaCustomer) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "promotion_persona_customer") 64 | } 65 | 66 | func (t *PromotionPersonaCustomerRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "promotion_persona_customer") 68 | } 69 | 70 | type PromotionPersonaCustomer struct { 71 | 72 | Customer *Customer `json:"customer,omitempty"` 73 | 74 | CustomerId string `json:"customerId,omitempty"` 75 | 76 | Promotion *Promotion `json:"promotion,omitempty"` 77 | 78 | PromotionId string `json:"promotionId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_system_config.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type SystemConfigRepository struct { 11 | *GenericRepository[SystemConfig] 12 | } 13 | 14 | func NewSystemConfigRepository(client *Client) *SystemConfigRepository { 15 | return &SystemConfigRepository{ 16 | GenericRepository: NewGenericRepository[SystemConfig](client), 17 | } 18 | } 19 | 20 | func (t *SystemConfigRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SystemConfig], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "system-config") 22 | } 23 | 24 | func (t *SystemConfigRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SystemConfig], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *SystemConfigRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "system-config") 62 | } 63 | 64 | func (t *SystemConfigRepository) Upsert(ctx ApiContext, entity []SystemConfig) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "system_config") 66 | } 67 | 68 | func (t *SystemConfigRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "system_config") 70 | } 71 | 72 | type SystemConfig struct { 73 | 74 | ConfigurationKey string `json:"configurationKey,omitempty"` 75 | 76 | ConfigurationValue interface{} `json:"configurationValue,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 83 | 84 | SalesChannelId string `json:"salesChannelId,omitempty"` 85 | 86 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_media_default_folder.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type MediaDefaultFolderRepository struct { 11 | *GenericRepository[MediaDefaultFolder] 12 | } 13 | 14 | func NewMediaDefaultFolderRepository(client *Client) *MediaDefaultFolderRepository { 15 | return &MediaDefaultFolderRepository{ 16 | GenericRepository: NewGenericRepository[MediaDefaultFolder](client), 17 | } 18 | } 19 | 20 | func (t *MediaDefaultFolderRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaDefaultFolder], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "media-default-folder") 22 | } 23 | 24 | func (t *MediaDefaultFolderRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaDefaultFolder], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *MediaDefaultFolderRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "media-default-folder") 62 | } 63 | 64 | func (t *MediaDefaultFolderRepository) Upsert(ctx ApiContext, entity []MediaDefaultFolder) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "media_default_folder") 66 | } 67 | 68 | func (t *MediaDefaultFolderRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "media_default_folder") 70 | } 71 | 72 | type MediaDefaultFolder struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Entity string `json:"entity,omitempty"` 79 | 80 | Folder *MediaFolder `json:"folder,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_product_stream_mapping.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductStreamMappingRepository struct { 9 | *GenericRepository[ProductStreamMapping] 10 | } 11 | 12 | func NewProductStreamMappingRepository(client *Client) *ProductStreamMappingRepository { 13 | return &ProductStreamMappingRepository{ 14 | GenericRepository: NewGenericRepository[ProductStreamMapping](client), 15 | } 16 | } 17 | 18 | func (t *ProductStreamMappingRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductStreamMapping], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-stream-mapping") 20 | } 21 | 22 | func (t *ProductStreamMappingRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductStreamMapping], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductStreamMappingRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-stream-mapping") 60 | } 61 | 62 | func (t *ProductStreamMappingRepository) Upsert(ctx ApiContext, entity []ProductStreamMapping) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_stream_mapping") 64 | } 65 | 66 | func (t *ProductStreamMappingRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_stream_mapping") 68 | } 69 | 70 | type ProductStreamMapping struct { 71 | 72 | Product *Product `json:"product,omitempty"` 73 | 74 | ProductId string `json:"productId,omitempty"` 75 | 76 | ProductStream *ProductStream `json:"productStream,omitempty"` 77 | 78 | ProductStreamId string `json:"productStreamId,omitempty"` 79 | 80 | ProductVersionId string `json:"productVersionId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_acl_role.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AclRoleRepository struct { 11 | *GenericRepository[AclRole] 12 | } 13 | 14 | func NewAclRoleRepository(client *Client) *AclRoleRepository { 15 | return &AclRoleRepository{ 16 | GenericRepository: NewGenericRepository[AclRole](client), 17 | } 18 | } 19 | 20 | func (t *AclRoleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AclRole], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "acl-role") 22 | } 23 | 24 | func (t *AclRoleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AclRole], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AclRoleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "acl-role") 62 | } 63 | 64 | func (t *AclRoleRepository) Upsert(ctx ApiContext, entity []AclRole) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "acl_role") 66 | } 67 | 68 | func (t *AclRoleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "acl_role") 70 | } 71 | 72 | type AclRole struct { 73 | 74 | App *App `json:"app,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | DeletedAt time.Time `json:"deletedAt,omitempty"` 79 | 80 | Description string `json:"description,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | Integrations []Integration `json:"integrations,omitempty"` 85 | 86 | Name string `json:"name,omitempty"` 87 | 88 | Privileges interface{} `json:"privileges,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | Users []User `json:"users,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_product_keyword_dictionary.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductKeywordDictionaryRepository struct { 9 | *GenericRepository[ProductKeywordDictionary] 10 | } 11 | 12 | func NewProductKeywordDictionaryRepository(client *Client) *ProductKeywordDictionaryRepository { 13 | return &ProductKeywordDictionaryRepository{ 14 | GenericRepository: NewGenericRepository[ProductKeywordDictionary](client), 15 | } 16 | } 17 | 18 | func (t *ProductKeywordDictionaryRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductKeywordDictionary], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-keyword-dictionary") 20 | } 21 | 22 | func (t *ProductKeywordDictionaryRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductKeywordDictionary], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductKeywordDictionaryRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-keyword-dictionary") 60 | } 61 | 62 | func (t *ProductKeywordDictionaryRepository) Upsert(ctx ApiContext, entity []ProductKeywordDictionary) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_keyword_dictionary") 64 | } 65 | 66 | func (t *ProductKeywordDictionaryRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_keyword_dictionary") 68 | } 69 | 70 | type ProductKeywordDictionary struct { 71 | 72 | Id string `json:"id,omitempty"` 73 | 74 | Keyword string `json:"keyword,omitempty"` 75 | 76 | Language *Language `json:"language,omitempty"` 77 | 78 | LanguageId string `json:"languageId,omitempty"` 79 | 80 | Reversed string `json:"reversed,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_mail_template_media.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type MailTemplateMediaRepository struct { 9 | *GenericRepository[MailTemplateMedia] 10 | } 11 | 12 | func NewMailTemplateMediaRepository(client *Client) *MailTemplateMediaRepository { 13 | return &MailTemplateMediaRepository{ 14 | GenericRepository: NewGenericRepository[MailTemplateMedia](client), 15 | } 16 | } 17 | 18 | func (t *MailTemplateMediaRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MailTemplateMedia], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "mail-template-media") 20 | } 21 | 22 | func (t *MailTemplateMediaRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MailTemplateMedia], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *MailTemplateMediaRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "mail-template-media") 60 | } 61 | 62 | func (t *MailTemplateMediaRepository) Upsert(ctx ApiContext, entity []MailTemplateMedia) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "mail_template_media") 64 | } 65 | 66 | func (t *MailTemplateMediaRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "mail_template_media") 68 | } 69 | 70 | type MailTemplateMedia struct { 71 | 72 | Id string `json:"id,omitempty"` 73 | 74 | LanguageId string `json:"languageId,omitempty"` 75 | 76 | MailTemplate *MailTemplate `json:"mailTemplate,omitempty"` 77 | 78 | MailTemplateId string `json:"mailTemplateId,omitempty"` 79 | 80 | Media *Media `json:"media,omitempty"` 81 | 82 | MediaId string `json:"mediaId,omitempty"` 83 | 84 | Position float64 `json:"position,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_notification.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | "time" 6 | ) 7 | 8 | type NotificationRepository struct { 9 | *GenericRepository[Notification] 10 | } 11 | 12 | func NewNotificationRepository(client *Client) *NotificationRepository { 13 | return &NotificationRepository{ 14 | GenericRepository: NewGenericRepository[Notification](client), 15 | } 16 | } 17 | 18 | func (t *NotificationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Notification], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "notification") 20 | } 21 | 22 | func (t *NotificationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Notification], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *NotificationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "notification") 60 | } 61 | 62 | func (t *NotificationRepository) Upsert(ctx ApiContext, entity []Notification) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "notification") 64 | } 65 | 66 | func (t *NotificationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "notification") 68 | } 69 | 70 | type Notification struct { 71 | Id string `json:"id,omitempty"` 72 | Status string `json:"status,omitempty"` 73 | Message string `json:"message,omitempty"` 74 | AdminOnly bool `json:"adminOnly,omitempty"` 75 | RequiredPrivileges []string `json:"requiredPrivileges,omitempty"` 76 | CreatedByIntegration *Integration `json:"createdByIntegration,omitempty"` 77 | CreatedByUser *User `json:"createdByUser,omitempty"` 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 80 | } 81 | -------------------------------------------------------------------------------- /repo_product_custom_field_set.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductCustomFieldSetRepository struct { 9 | *GenericRepository[ProductCustomFieldSet] 10 | } 11 | 12 | func NewProductCustomFieldSetRepository(client *Client) *ProductCustomFieldSetRepository { 13 | return &ProductCustomFieldSetRepository{ 14 | GenericRepository: NewGenericRepository[ProductCustomFieldSet](client), 15 | } 16 | } 17 | 18 | func (t *ProductCustomFieldSetRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCustomFieldSet], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-custom-field-set") 20 | } 21 | 22 | func (t *ProductCustomFieldSetRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCustomFieldSet], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductCustomFieldSetRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-custom-field-set") 60 | } 61 | 62 | func (t *ProductCustomFieldSetRepository) Upsert(ctx ApiContext, entity []ProductCustomFieldSet) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_custom_field_set") 64 | } 65 | 66 | func (t *ProductCustomFieldSetRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_custom_field_set") 68 | } 69 | 70 | type ProductCustomFieldSet struct { 71 | 72 | CustomFieldSet *CustomFieldSet `json:"customFieldSet,omitempty"` 73 | 74 | CustomFieldSetId string `json:"customFieldSetId,omitempty"` 75 | 76 | Product *Product `json:"product,omitempty"` 77 | 78 | ProductId string `json:"productId,omitempty"` 79 | 80 | ProductVersionId string `json:"productVersionId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_app_flow_event.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppFlowEventRepository struct { 11 | *GenericRepository[AppFlowEvent] 12 | } 13 | 14 | func NewAppFlowEventRepository(client *Client) *AppFlowEventRepository { 15 | return &AppFlowEventRepository{ 16 | GenericRepository: NewGenericRepository[AppFlowEvent](client), 17 | } 18 | } 19 | 20 | func (t *AppFlowEventRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppFlowEvent], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-flow-event") 22 | } 23 | 24 | func (t *AppFlowEventRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppFlowEvent], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppFlowEventRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-flow-event") 62 | } 63 | 64 | func (t *AppFlowEventRepository) Upsert(ctx ApiContext, entity []AppFlowEvent) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_flow_event") 66 | } 67 | 68 | func (t *AppFlowEventRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_flow_event") 70 | } 71 | 72 | type AppFlowEvent struct { 73 | 74 | App *App `json:"app,omitempty"` 75 | 76 | AppId string `json:"appId,omitempty"` 77 | 78 | Aware interface{} `json:"aware,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | CustomFields interface{} `json:"customFields,omitempty"` 83 | 84 | Flows []Flow `json:"flows,omitempty"` 85 | 86 | Id string `json:"id,omitempty"` 87 | 88 | Name string `json:"name,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_product_category_tree.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type ProductCategoryTreeRepository struct { 9 | *GenericRepository[ProductCategoryTree] 10 | } 11 | 12 | func NewProductCategoryTreeRepository(client *Client) *ProductCategoryTreeRepository { 13 | return &ProductCategoryTreeRepository{ 14 | GenericRepository: NewGenericRepository[ProductCategoryTree](client), 15 | } 16 | } 17 | 18 | func (t *ProductCategoryTreeRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCategoryTree], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "product-category-tree") 20 | } 21 | 22 | func (t *ProductCategoryTreeRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductCategoryTree], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *ProductCategoryTreeRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "product-category-tree") 60 | } 61 | 62 | func (t *ProductCategoryTreeRepository) Upsert(ctx ApiContext, entity []ProductCategoryTree) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "product_category_tree") 64 | } 65 | 66 | func (t *ProductCategoryTreeRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "product_category_tree") 68 | } 69 | 70 | type ProductCategoryTree struct { 71 | 72 | Category *Category `json:"category,omitempty"` 73 | 74 | CategoryId string `json:"categoryId,omitempty"` 75 | 76 | CategoryVersionId string `json:"categoryVersionId,omitempty"` 77 | 78 | Product *Product `json:"product,omitempty"` 79 | 80 | ProductId string `json:"productId,omitempty"` 81 | 82 | ProductVersionId string `json:"productVersionId,omitempty"` 83 | 84 | } 85 | -------------------------------------------------------------------------------- /repo_snippet_set.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type SnippetSetRepository struct { 11 | *GenericRepository[SnippetSet] 12 | } 13 | 14 | func NewSnippetSetRepository(client *Client) *SnippetSetRepository { 15 | return &SnippetSetRepository{ 16 | GenericRepository: NewGenericRepository[SnippetSet](client), 17 | } 18 | } 19 | 20 | func (t *SnippetSetRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SnippetSet], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "snippet-set") 22 | } 23 | 24 | func (t *SnippetSetRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SnippetSet], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *SnippetSetRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "snippet-set") 62 | } 63 | 64 | func (t *SnippetSetRepository) Upsert(ctx ApiContext, entity []SnippetSet) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "snippet_set") 66 | } 67 | 68 | func (t *SnippetSetRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "snippet_set") 70 | } 71 | 72 | type SnippetSet struct { 73 | 74 | BaseFile string `json:"baseFile,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | CustomFields interface{} `json:"customFields,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Iso string `json:"iso,omitempty"` 83 | 84 | Name string `json:"name,omitempty"` 85 | 86 | SalesChannelDomains []SalesChannelDomain `json:"salesChannelDomains,omitempty"` 87 | 88 | Snippets []Snippet `json:"snippets,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_webhook.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type WebhookRepository struct { 11 | *GenericRepository[Webhook] 12 | } 13 | 14 | func NewWebhookRepository(client *Client) *WebhookRepository { 15 | return &WebhookRepository{ 16 | GenericRepository: NewGenericRepository[Webhook](client), 17 | } 18 | } 19 | 20 | func (t *WebhookRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Webhook], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "webhook") 22 | } 23 | 24 | func (t *WebhookRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Webhook], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *WebhookRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "webhook") 62 | } 63 | 64 | func (t *WebhookRepository) Upsert(ctx ApiContext, entity []Webhook) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "webhook") 66 | } 67 | 68 | func (t *WebhookRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "webhook") 70 | } 71 | 72 | type Webhook struct { 73 | 74 | Active bool `json:"active,omitempty"` 75 | 76 | App *App `json:"app,omitempty"` 77 | 78 | AppId string `json:"appId,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | ErrorCount float64 `json:"errorCount,omitempty"` 83 | 84 | EventName string `json:"eventName,omitempty"` 85 | 86 | Id string `json:"id,omitempty"` 87 | 88 | Name string `json:"name,omitempty"` 89 | 90 | OnlyLiveVersion bool `json:"onlyLiveVersion,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | Url string `json:"url,omitempty"` 95 | 96 | } 97 | -------------------------------------------------------------------------------- /repo_sales_channel_payment_method.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type SalesChannelPaymentMethodRepository struct { 9 | *GenericRepository[SalesChannelPaymentMethod] 10 | } 11 | 12 | func NewSalesChannelPaymentMethodRepository(client *Client) *SalesChannelPaymentMethodRepository { 13 | return &SalesChannelPaymentMethodRepository{ 14 | GenericRepository: NewGenericRepository[SalesChannelPaymentMethod](client), 15 | } 16 | } 17 | 18 | func (t *SalesChannelPaymentMethodRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelPaymentMethod], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-payment-method") 20 | } 21 | 22 | func (t *SalesChannelPaymentMethodRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelPaymentMethod], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *SalesChannelPaymentMethodRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-payment-method") 60 | } 61 | 62 | func (t *SalesChannelPaymentMethodRepository) Upsert(ctx ApiContext, entity []SalesChannelPaymentMethod) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_payment_method") 64 | } 65 | 66 | func (t *SalesChannelPaymentMethodRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_payment_method") 68 | } 69 | 70 | type SalesChannelPaymentMethod struct { 71 | 72 | PaymentMethod *PaymentMethod `json:"paymentMethod,omitempty"` 73 | 74 | PaymentMethodId string `json:"paymentMethodId,omitempty"` 75 | 76 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 77 | 78 | SalesChannelId string `json:"salesChannelId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_locale.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type LocaleRepository struct { 11 | *GenericRepository[Locale] 12 | } 13 | 14 | func NewLocaleRepository(client *Client) *LocaleRepository { 15 | return &LocaleRepository{ 16 | GenericRepository: NewGenericRepository[Locale](client), 17 | } 18 | } 19 | 20 | func (t *LocaleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[Locale], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "locale") 22 | } 23 | 24 | func (t *LocaleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[Locale], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *LocaleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "locale") 62 | } 63 | 64 | func (t *LocaleRepository) Upsert(ctx ApiContext, entity []Locale) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "locale") 66 | } 67 | 68 | func (t *LocaleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "locale") 70 | } 71 | 72 | type Locale struct { 73 | 74 | Code string `json:"code,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | CustomFields interface{} `json:"customFields,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Languages []Language `json:"languages,omitempty"` 83 | 84 | Name string `json:"name,omitempty"` 85 | 86 | Territory string `json:"territory,omitempty"` 87 | 88 | Translated interface{} `json:"translated,omitempty"` 89 | 90 | Translations []LocaleTranslation `json:"translations,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | Users []User `json:"users,omitempty"` 95 | 96 | } 97 | -------------------------------------------------------------------------------- /repo_sales_channel_shipping_method.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type SalesChannelShippingMethodRepository struct { 9 | *GenericRepository[SalesChannelShippingMethod] 10 | } 11 | 12 | func NewSalesChannelShippingMethodRepository(client *Client) *SalesChannelShippingMethodRepository { 13 | return &SalesChannelShippingMethodRepository{ 14 | GenericRepository: NewGenericRepository[SalesChannelShippingMethod](client), 15 | } 16 | } 17 | 18 | func (t *SalesChannelShippingMethodRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelShippingMethod], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-shipping-method") 20 | } 21 | 22 | func (t *SalesChannelShippingMethodRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelShippingMethod], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *SalesChannelShippingMethodRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-shipping-method") 60 | } 61 | 62 | func (t *SalesChannelShippingMethodRepository) Upsert(ctx ApiContext, entity []SalesChannelShippingMethod) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_shipping_method") 64 | } 65 | 66 | func (t *SalesChannelShippingMethodRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_shipping_method") 68 | } 69 | 70 | type SalesChannelShippingMethod struct { 71 | 72 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 73 | 74 | SalesChannelId string `json:"salesChannelId,omitempty"` 75 | 76 | ShippingMethod *ShippingMethod `json:"shippingMethod,omitempty"` 77 | 78 | ShippingMethodId string `json:"shippingMethodId,omitempty"` 79 | 80 | } 81 | -------------------------------------------------------------------------------- /repo_tax_rule_type.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type TaxRuleTypeRepository struct { 11 | *GenericRepository[TaxRuleType] 12 | } 13 | 14 | func NewTaxRuleTypeRepository(client *Client) *TaxRuleTypeRepository { 15 | return &TaxRuleTypeRepository{ 16 | GenericRepository: NewGenericRepository[TaxRuleType](client), 17 | } 18 | } 19 | 20 | func (t *TaxRuleTypeRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRuleType], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "tax-rule-type") 22 | } 23 | 24 | func (t *TaxRuleTypeRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRuleType], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *TaxRuleTypeRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "tax-rule-type") 62 | } 63 | 64 | func (t *TaxRuleTypeRepository) Upsert(ctx ApiContext, entity []TaxRuleType) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "tax_rule_type") 66 | } 67 | 68 | func (t *TaxRuleTypeRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "tax_rule_type") 70 | } 71 | 72 | type TaxRuleType struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | Position float64 `json:"position,omitempty"` 79 | 80 | Rules []TaxRule `json:"rules,omitempty"` 81 | 82 | TechnicalName string `json:"technicalName,omitempty"` 83 | 84 | Translated interface{} `json:"translated,omitempty"` 85 | 86 | Translations []TaxRuleTypeTranslation `json:"translations,omitempty"` 87 | 88 | TypeName string `json:"typeName,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_landing_page_sales_channel.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | ) 7 | 8 | type LandingPageSalesChannelRepository struct { 9 | *GenericRepository[LandingPageSalesChannel] 10 | } 11 | 12 | func NewLandingPageSalesChannelRepository(client *Client) *LandingPageSalesChannelRepository { 13 | return &LandingPageSalesChannelRepository{ 14 | GenericRepository: NewGenericRepository[LandingPageSalesChannel](client), 15 | } 16 | } 17 | 18 | func (t *LandingPageSalesChannelRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[LandingPageSalesChannel], *http.Response, error) { 19 | return t.GenericRepository.Search(ctx, criteria, "landing-page-sales-channel") 20 | } 21 | 22 | func (t *LandingPageSalesChannelRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[LandingPageSalesChannel], *http.Response, error) { 23 | if criteria.Limit == 0 { 24 | criteria.Limit = 50 25 | } 26 | 27 | if criteria.Page == 0 { 28 | criteria.Page = 1 29 | } 30 | 31 | c, resp, err := t.Search(ctx, criteria) 32 | 33 | if err != nil { 34 | return c, resp, err 35 | } 36 | 37 | for { 38 | criteria.Page++ 39 | 40 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 41 | 42 | if nextErr != nil { 43 | return c, nextResp, nextErr 44 | } 45 | 46 | if len(nextC.Data) == 0 { 47 | break 48 | } 49 | 50 | c.Data = append(c.Data, nextC.Data...) 51 | } 52 | 53 | c.Total = int64(len(c.Data)) 54 | 55 | return c, resp, err 56 | } 57 | 58 | func (t *LandingPageSalesChannelRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 59 | return t.GenericRepository.SearchIds(ctx, criteria, "landing-page-sales-channel") 60 | } 61 | 62 | func (t *LandingPageSalesChannelRepository) Upsert(ctx ApiContext, entity []LandingPageSalesChannel) (*http.Response, error) { 63 | return t.GenericRepository.Upsert(ctx, entity, "landing_page_sales_channel") 64 | } 65 | 66 | func (t *LandingPageSalesChannelRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 67 | return t.GenericRepository.Delete(ctx, ids, "landing_page_sales_channel") 68 | } 69 | 70 | type LandingPageSalesChannel struct { 71 | 72 | LandingPage *LandingPage `json:"landingPage,omitempty"` 73 | 74 | LandingPageId string `json:"landingPageId,omitempty"` 75 | 76 | LandingPageVersionId string `json:"landingPageVersionId,omitempty"` 77 | 78 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 79 | 80 | SalesChannelId string `json:"salesChannelId,omitempty"` 81 | 82 | } 83 | -------------------------------------------------------------------------------- /repo_app_administration_snippet.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppAdministrationSnippetRepository struct { 11 | *GenericRepository[AppAdministrationSnippet] 12 | } 13 | 14 | func NewAppAdministrationSnippetRepository(client *Client) *AppAdministrationSnippetRepository { 15 | return &AppAdministrationSnippetRepository{ 16 | GenericRepository: NewGenericRepository[AppAdministrationSnippet](client), 17 | } 18 | } 19 | 20 | func (t *AppAdministrationSnippetRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppAdministrationSnippet], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-administration-snippet") 22 | } 23 | 24 | func (t *AppAdministrationSnippetRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppAdministrationSnippet], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppAdministrationSnippetRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-administration-snippet") 62 | } 63 | 64 | func (t *AppAdministrationSnippetRepository) Upsert(ctx ApiContext, entity []AppAdministrationSnippet) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_administration_snippet") 66 | } 67 | 68 | func (t *AppAdministrationSnippetRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_administration_snippet") 70 | } 71 | 72 | type AppAdministrationSnippet struct { 73 | 74 | AppId string `json:"appId,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | LocaleId string `json:"localeId,omitempty"` 81 | 82 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 83 | 84 | Value string `json:"value,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_user_access_key.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type UserAccessKeyRepository struct { 11 | *GenericRepository[UserAccessKey] 12 | } 13 | 14 | func NewUserAccessKeyRepository(client *Client) *UserAccessKeyRepository { 15 | return &UserAccessKeyRepository{ 16 | GenericRepository: NewGenericRepository[UserAccessKey](client), 17 | } 18 | } 19 | 20 | func (t *UserAccessKeyRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[UserAccessKey], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "user-access-key") 22 | } 23 | 24 | func (t *UserAccessKeyRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[UserAccessKey], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *UserAccessKeyRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "user-access-key") 62 | } 63 | 64 | func (t *UserAccessKeyRepository) Upsert(ctx ApiContext, entity []UserAccessKey) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "user_access_key") 66 | } 67 | 68 | func (t *UserAccessKeyRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "user_access_key") 70 | } 71 | 72 | type UserAccessKey struct { 73 | 74 | AccessKey string `json:"accessKey,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | CustomFields interface{} `json:"customFields,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | LastUsageAt time.Time `json:"lastUsageAt,omitempty"` 83 | 84 | SecretAccessKey interface{} `json:"secretAccessKey,omitempty"` 85 | 86 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 87 | 88 | User *User `json:"user,omitempty"` 89 | 90 | UserId string `json:"userId,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_media_thumbnail_size.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type MediaThumbnailSizeRepository struct { 11 | *GenericRepository[MediaThumbnailSize] 12 | } 13 | 14 | func NewMediaThumbnailSizeRepository(client *Client) *MediaThumbnailSizeRepository { 15 | return &MediaThumbnailSizeRepository{ 16 | GenericRepository: NewGenericRepository[MediaThumbnailSize](client), 17 | } 18 | } 19 | 20 | func (t *MediaThumbnailSizeRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaThumbnailSize], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "media-thumbnail-size") 22 | } 23 | 24 | func (t *MediaThumbnailSizeRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaThumbnailSize], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *MediaThumbnailSizeRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "media-thumbnail-size") 62 | } 63 | 64 | func (t *MediaThumbnailSizeRepository) Upsert(ctx ApiContext, entity []MediaThumbnailSize) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "media_thumbnail_size") 66 | } 67 | 68 | func (t *MediaThumbnailSizeRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "media_thumbnail_size") 70 | } 71 | 72 | type MediaThumbnailSize struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Height float64 `json:"height,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | MediaFolderConfigurations []MediaFolderConfiguration `json:"mediaFolderConfigurations,omitempty"` 83 | 84 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 85 | 86 | Width float64 `json:"width,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_custom_field_set_relation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type CustomFieldSetRelationRepository struct { 11 | *GenericRepository[CustomFieldSetRelation] 12 | } 13 | 14 | func NewCustomFieldSetRelationRepository(client *Client) *CustomFieldSetRelationRepository { 15 | return &CustomFieldSetRelationRepository{ 16 | GenericRepository: NewGenericRepository[CustomFieldSetRelation](client), 17 | } 18 | } 19 | 20 | func (t *CustomFieldSetRelationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomFieldSetRelation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "custom-field-set-relation") 22 | } 23 | 24 | func (t *CustomFieldSetRelationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomFieldSetRelation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *CustomFieldSetRelationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "custom-field-set-relation") 62 | } 63 | 64 | func (t *CustomFieldSetRelationRepository) Upsert(ctx ApiContext, entity []CustomFieldSetRelation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "custom_field_set_relation") 66 | } 67 | 68 | func (t *CustomFieldSetRelationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "custom_field_set_relation") 70 | } 71 | 72 | type CustomFieldSetRelation struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFieldSet *CustomFieldSet `json:"customFieldSet,omitempty"` 77 | 78 | CustomFieldSetId string `json:"customFieldSetId,omitempty"` 79 | 80 | EntityName string `json:"entityName,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 85 | 86 | } 87 | -------------------------------------------------------------------------------- /repo_unit_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type UnitTranslationRepository struct { 11 | *GenericRepository[UnitTranslation] 12 | } 13 | 14 | func NewUnitTranslationRepository(client *Client) *UnitTranslationRepository { 15 | return &UnitTranslationRepository{ 16 | GenericRepository: NewGenericRepository[UnitTranslation](client), 17 | } 18 | } 19 | 20 | func (t *UnitTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[UnitTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "unit-translation") 22 | } 23 | 24 | func (t *UnitTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[UnitTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *UnitTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "unit-translation") 62 | } 63 | 64 | func (t *UnitTranslationRepository) Upsert(ctx ApiContext, entity []UnitTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "unit_translation") 66 | } 67 | 68 | func (t *UnitTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "unit_translation") 70 | } 71 | 72 | type UnitTranslation struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Language *Language `json:"language,omitempty"` 79 | 80 | LanguageId string `json:"languageId,omitempty"` 81 | 82 | Name string `json:"name,omitempty"` 83 | 84 | ShortCode string `json:"shortCode,omitempty"` 85 | 86 | Unit *Unit `json:"unit,omitempty"` 87 | 88 | UnitId string `json:"unitId,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_media_thumbnail.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type MediaThumbnailRepository struct { 11 | *GenericRepository[MediaThumbnail] 12 | } 13 | 14 | func NewMediaThumbnailRepository(client *Client) *MediaThumbnailRepository { 15 | return &MediaThumbnailRepository{ 16 | GenericRepository: NewGenericRepository[MediaThumbnail](client), 17 | } 18 | } 19 | 20 | func (t *MediaThumbnailRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaThumbnail], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "media-thumbnail") 22 | } 23 | 24 | func (t *MediaThumbnailRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaThumbnail], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *MediaThumbnailRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "media-thumbnail") 62 | } 63 | 64 | func (t *MediaThumbnailRepository) Upsert(ctx ApiContext, entity []MediaThumbnail) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "media_thumbnail") 66 | } 67 | 68 | func (t *MediaThumbnailRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "media_thumbnail") 70 | } 71 | 72 | type MediaThumbnail struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Height float64 `json:"height,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Media *Media `json:"media,omitempty"` 83 | 84 | MediaId string `json:"mediaId,omitempty"` 85 | 86 | Path string `json:"path,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | Url string `json:"url,omitempty"` 91 | 92 | Width float64 `json:"width,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_tax_rule.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type TaxRuleRepository struct { 11 | *GenericRepository[TaxRule] 12 | } 13 | 14 | func NewTaxRuleRepository(client *Client) *TaxRuleRepository { 15 | return &TaxRuleRepository{ 16 | GenericRepository: NewGenericRepository[TaxRule](client), 17 | } 18 | } 19 | 20 | func (t *TaxRuleRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRule], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "tax-rule") 22 | } 23 | 24 | func (t *TaxRuleRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRule], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *TaxRuleRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "tax-rule") 62 | } 63 | 64 | func (t *TaxRuleRepository) Upsert(ctx ApiContext, entity []TaxRule) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "tax_rule") 66 | } 67 | 68 | func (t *TaxRuleRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "tax_rule") 70 | } 71 | 72 | type TaxRule struct { 73 | 74 | ActiveFrom time.Time `json:"activeFrom,omitempty"` 75 | 76 | Country *Country `json:"country,omitempty"` 77 | 78 | CountryId string `json:"countryId,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | Data interface{} `json:"data,omitempty"` 83 | 84 | Id string `json:"id,omitempty"` 85 | 86 | Tax *Tax `json:"tax,omitempty"` 87 | 88 | TaxId string `json:"taxId,omitempty"` 89 | 90 | TaxRate float64 `json:"taxRate,omitempty"` 91 | 92 | TaxRuleTypeId string `json:"taxRuleTypeId,omitempty"` 93 | 94 | Type *TaxRuleType `json:"type,omitempty"` 95 | 96 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 97 | 98 | } 99 | -------------------------------------------------------------------------------- /repo_media_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type MediaTranslationRepository struct { 11 | *GenericRepository[MediaTranslation] 12 | } 13 | 14 | func NewMediaTranslationRepository(client *Client) *MediaTranslationRepository { 15 | return &MediaTranslationRepository{ 16 | GenericRepository: NewGenericRepository[MediaTranslation](client), 17 | } 18 | } 19 | 20 | func (t *MediaTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "media-translation") 22 | } 23 | 24 | func (t *MediaTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[MediaTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *MediaTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "media-translation") 62 | } 63 | 64 | func (t *MediaTranslationRepository) Upsert(ctx ApiContext, entity []MediaTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "media_translation") 66 | } 67 | 68 | func (t *MediaTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "media_translation") 70 | } 71 | 72 | type MediaTranslation struct { 73 | 74 | Alt string `json:"alt,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | CustomFields interface{} `json:"customFields,omitempty"` 79 | 80 | Language *Language `json:"language,omitempty"` 81 | 82 | LanguageId string `json:"languageId,omitempty"` 83 | 84 | Media *Media `json:"media,omitempty"` 85 | 86 | MediaId string `json:"mediaId,omitempty"` 87 | 88 | Title string `json:"title,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_import_export_file.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type ImportExportFileRepository struct { 11 | *GenericRepository[ImportExportFile] 12 | } 13 | 14 | func NewImportExportFileRepository(client *Client) *ImportExportFileRepository { 15 | return &ImportExportFileRepository{ 16 | GenericRepository: NewGenericRepository[ImportExportFile](client), 17 | } 18 | } 19 | 20 | func (t *ImportExportFileRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ImportExportFile], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "import-export-file") 22 | } 23 | 24 | func (t *ImportExportFileRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ImportExportFile], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *ImportExportFileRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "import-export-file") 62 | } 63 | 64 | func (t *ImportExportFileRepository) Upsert(ctx ApiContext, entity []ImportExportFile) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "import_export_file") 66 | } 67 | 68 | func (t *ImportExportFileRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "import_export_file") 70 | } 71 | 72 | type ImportExportFile struct { 73 | 74 | AccessToken string `json:"accessToken,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | ExpireDate time.Time `json:"expireDate,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Log *ImportExportLog `json:"log,omitempty"` 83 | 84 | OriginalName string `json:"originalName,omitempty"` 85 | 86 | Path string `json:"path,omitempty"` 87 | 88 | Size float64 `json:"size,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_promotion_individual_code.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type PromotionIndividualCodeRepository struct { 11 | *GenericRepository[PromotionIndividualCode] 12 | } 13 | 14 | func NewPromotionIndividualCodeRepository(client *Client) *PromotionIndividualCodeRepository { 15 | return &PromotionIndividualCodeRepository{ 16 | GenericRepository: NewGenericRepository[PromotionIndividualCode](client), 17 | } 18 | } 19 | 20 | func (t *PromotionIndividualCodeRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionIndividualCode], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "promotion-individual-code") 22 | } 23 | 24 | func (t *PromotionIndividualCodeRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionIndividualCode], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *PromotionIndividualCodeRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-individual-code") 62 | } 63 | 64 | func (t *PromotionIndividualCodeRepository) Upsert(ctx ApiContext, entity []PromotionIndividualCode) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "promotion_individual_code") 66 | } 67 | 68 | func (t *PromotionIndividualCodeRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "promotion_individual_code") 70 | } 71 | 72 | type PromotionIndividualCode struct { 73 | 74 | Code string `json:"code,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | Payload interface{} `json:"payload,omitempty"` 81 | 82 | Promotion *Promotion `json:"promotion,omitempty"` 83 | 84 | PromotionId string `json:"promotionId,omitempty"` 85 | 86 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_app_cms_block_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppCmsBlockTranslationRepository struct { 11 | *GenericRepository[AppCmsBlockTranslation] 12 | } 13 | 14 | func NewAppCmsBlockTranslationRepository(client *Client) *AppCmsBlockTranslationRepository { 15 | return &AppCmsBlockTranslationRepository{ 16 | GenericRepository: NewGenericRepository[AppCmsBlockTranslation](client), 17 | } 18 | } 19 | 20 | func (t *AppCmsBlockTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppCmsBlockTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-cms-block-translation") 22 | } 23 | 24 | func (t *AppCmsBlockTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppCmsBlockTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppCmsBlockTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-cms-block-translation") 62 | } 63 | 64 | func (t *AppCmsBlockTranslationRepository) Upsert(ctx ApiContext, entity []AppCmsBlockTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_cms_block_translation") 66 | } 67 | 68 | func (t *AppCmsBlockTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_cms_block_translation") 70 | } 71 | 72 | type AppCmsBlockTranslation struct { 73 | 74 | AppCmsBlock *AppCmsBlock `json:"appCmsBlock,omitempty"` 75 | 76 | AppCmsBlockId string `json:"appCmsBlockId,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | Label string `json:"label,omitempty"` 81 | 82 | Language *Language `json:"language,omitempty"` 83 | 84 | LanguageId string `json:"languageId,omitempty"` 85 | 86 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_locale_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type LocaleTranslationRepository struct { 11 | *GenericRepository[LocaleTranslation] 12 | } 13 | 14 | func NewLocaleTranslationRepository(client *Client) *LocaleTranslationRepository { 15 | return &LocaleTranslationRepository{ 16 | GenericRepository: NewGenericRepository[LocaleTranslation](client), 17 | } 18 | } 19 | 20 | func (t *LocaleTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[LocaleTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "locale-translation") 22 | } 23 | 24 | func (t *LocaleTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[LocaleTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *LocaleTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "locale-translation") 62 | } 63 | 64 | func (t *LocaleTranslationRepository) Upsert(ctx ApiContext, entity []LocaleTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "locale_translation") 66 | } 67 | 68 | func (t *LocaleTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "locale_translation") 70 | } 71 | 72 | type LocaleTranslation struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Language *Language `json:"language,omitempty"` 79 | 80 | LanguageId string `json:"languageId,omitempty"` 81 | 82 | Locale *Locale `json:"locale,omitempty"` 83 | 84 | LocaleId string `json:"localeId,omitempty"` 85 | 86 | Name string `json:"name,omitempty"` 87 | 88 | Territory string `json:"territory,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_promotion_setgroup.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type PromotionSetgroupRepository struct { 11 | *GenericRepository[PromotionSetgroup] 12 | } 13 | 14 | func NewPromotionSetgroupRepository(client *Client) *PromotionSetgroupRepository { 15 | return &PromotionSetgroupRepository{ 16 | GenericRepository: NewGenericRepository[PromotionSetgroup](client), 17 | } 18 | } 19 | 20 | func (t *PromotionSetgroupRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSetgroup], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "promotion-setgroup") 22 | } 23 | 24 | func (t *PromotionSetgroupRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSetgroup], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *PromotionSetgroupRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-setgroup") 62 | } 63 | 64 | func (t *PromotionSetgroupRepository) Upsert(ctx ApiContext, entity []PromotionSetgroup) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "promotion_setgroup") 66 | } 67 | 68 | func (t *PromotionSetgroupRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "promotion_setgroup") 70 | } 71 | 72 | type PromotionSetgroup struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | PackagerKey string `json:"packagerKey,omitempty"` 79 | 80 | Promotion *Promotion `json:"promotion,omitempty"` 81 | 82 | PromotionId string `json:"promotionId,omitempty"` 83 | 84 | SetGroupRules []Rule `json:"setGroupRules,omitempty"` 85 | 86 | SorterKey string `json:"sorterKey,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | Value float64 `json:"value,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_tax_rule_type_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type TaxRuleTypeTranslationRepository struct { 11 | *GenericRepository[TaxRuleTypeTranslation] 12 | } 13 | 14 | func NewTaxRuleTypeTranslationRepository(client *Client) *TaxRuleTypeTranslationRepository { 15 | return &TaxRuleTypeTranslationRepository{ 16 | GenericRepository: NewGenericRepository[TaxRuleTypeTranslation](client), 17 | } 18 | } 19 | 20 | func (t *TaxRuleTypeTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRuleTypeTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "tax-rule-type-translation") 22 | } 23 | 24 | func (t *TaxRuleTypeTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[TaxRuleTypeTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *TaxRuleTypeTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "tax-rule-type-translation") 62 | } 63 | 64 | func (t *TaxRuleTypeTranslationRepository) Upsert(ctx ApiContext, entity []TaxRuleTypeTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "tax_rule_type_translation") 66 | } 67 | 68 | func (t *TaxRuleTypeTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "tax_rule_type_translation") 70 | } 71 | 72 | type TaxRuleTypeTranslation struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Language *Language `json:"language,omitempty"` 77 | 78 | LanguageId string `json:"languageId,omitempty"` 79 | 80 | TaxRuleType *TaxRuleType `json:"taxRuleType,omitempty"` 81 | 82 | TaxRuleTypeId string `json:"taxRuleTypeId,omitempty"` 83 | 84 | TypeName string `json:"typeName,omitempty"` 85 | 86 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 87 | 88 | } 89 | -------------------------------------------------------------------------------- /repo_promotion_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type PromotionTranslationRepository struct { 11 | *GenericRepository[PromotionTranslation] 12 | } 13 | 14 | func NewPromotionTranslationRepository(client *Client) *PromotionTranslationRepository { 15 | return &PromotionTranslationRepository{ 16 | GenericRepository: NewGenericRepository[PromotionTranslation](client), 17 | } 18 | } 19 | 20 | func (t *PromotionTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "promotion-translation") 22 | } 23 | 24 | func (t *PromotionTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *PromotionTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-translation") 62 | } 63 | 64 | func (t *PromotionTranslationRepository) Upsert(ctx ApiContext, entity []PromotionTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "promotion_translation") 66 | } 67 | 68 | func (t *PromotionTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "promotion_translation") 70 | } 71 | 72 | type PromotionTranslation struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Language *Language `json:"language,omitempty"` 79 | 80 | LanguageId string `json:"languageId,omitempty"` 81 | 82 | Name string `json:"name,omitempty"` 83 | 84 | Promotion *Promotion `json:"promotion,omitempty"` 85 | 86 | PromotionId string `json:"promotionId,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | } 91 | -------------------------------------------------------------------------------- /repo_sales_channel_analytics.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type SalesChannelAnalyticsRepository struct { 11 | *GenericRepository[SalesChannelAnalytics] 12 | } 13 | 14 | func NewSalesChannelAnalyticsRepository(client *Client) *SalesChannelAnalyticsRepository { 15 | return &SalesChannelAnalyticsRepository{ 16 | GenericRepository: NewGenericRepository[SalesChannelAnalytics](client), 17 | } 18 | } 19 | 20 | func (t *SalesChannelAnalyticsRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelAnalytics], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "sales-channel-analytics") 22 | } 23 | 24 | func (t *SalesChannelAnalyticsRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SalesChannelAnalytics], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *SalesChannelAnalyticsRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "sales-channel-analytics") 62 | } 63 | 64 | func (t *SalesChannelAnalyticsRepository) Upsert(ctx ApiContext, entity []SalesChannelAnalytics) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "sales_channel_analytics") 66 | } 67 | 68 | func (t *SalesChannelAnalyticsRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "sales_channel_analytics") 70 | } 71 | 72 | type SalesChannelAnalytics struct { 73 | 74 | Active bool `json:"active,omitempty"` 75 | 76 | AnonymizeIp bool `json:"anonymizeIp,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 83 | 84 | TrackOrders bool `json:"trackOrders,omitempty"` 85 | 86 | TrackingId string `json:"trackingId,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | } 91 | -------------------------------------------------------------------------------- /repo_app_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppTranslationRepository struct { 11 | *GenericRepository[AppTranslation] 12 | } 13 | 14 | func NewAppTranslationRepository(client *Client) *AppTranslationRepository { 15 | return &AppTranslationRepository{ 16 | GenericRepository: NewGenericRepository[AppTranslation](client), 17 | } 18 | } 19 | 20 | func (t *AppTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-translation") 22 | } 23 | 24 | func (t *AppTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-translation") 62 | } 63 | 64 | func (t *AppTranslationRepository) Upsert(ctx ApiContext, entity []AppTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_translation") 66 | } 67 | 68 | func (t *AppTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_translation") 70 | } 71 | 72 | type AppTranslation struct { 73 | 74 | App *App `json:"app,omitempty"` 75 | 76 | AppId string `json:"appId,omitempty"` 77 | 78 | CreatedAt time.Time `json:"createdAt,omitempty"` 79 | 80 | CustomFields interface{} `json:"customFields,omitempty"` 81 | 82 | Description string `json:"description,omitempty"` 83 | 84 | Label string `json:"label,omitempty"` 85 | 86 | Language *Language `json:"language,omitempty"` 87 | 88 | LanguageId string `json:"languageId,omitempty"` 89 | 90 | PrivacyPolicyExtensions string `json:"privacyPolicyExtensions,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_customer_wishlist.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type CustomerWishlistRepository struct { 11 | *GenericRepository[CustomerWishlist] 12 | } 13 | 14 | func NewCustomerWishlistRepository(client *Client) *CustomerWishlistRepository { 15 | return &CustomerWishlistRepository{ 16 | GenericRepository: NewGenericRepository[CustomerWishlist](client), 17 | } 18 | } 19 | 20 | func (t *CustomerWishlistRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerWishlist], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "customer-wishlist") 22 | } 23 | 24 | func (t *CustomerWishlistRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CustomerWishlist], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *CustomerWishlistRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "customer-wishlist") 62 | } 63 | 64 | func (t *CustomerWishlistRepository) Upsert(ctx ApiContext, entity []CustomerWishlist) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "customer_wishlist") 66 | } 67 | 68 | func (t *CustomerWishlistRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "customer_wishlist") 70 | } 71 | 72 | type CustomerWishlist struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | Customer *Customer `json:"customer,omitempty"` 79 | 80 | CustomerId string `json:"customerId,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | Products []CustomerWishlistProduct `json:"products,omitempty"` 85 | 86 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 87 | 88 | SalesChannelId string `json:"salesChannelId,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_product_visibility.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type ProductVisibilityRepository struct { 11 | *GenericRepository[ProductVisibility] 12 | } 13 | 14 | func NewProductVisibilityRepository(client *Client) *ProductVisibilityRepository { 15 | return &ProductVisibilityRepository{ 16 | GenericRepository: NewGenericRepository[ProductVisibility](client), 17 | } 18 | } 19 | 20 | func (t *ProductVisibilityRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductVisibility], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "product-visibility") 22 | } 23 | 24 | func (t *ProductVisibilityRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductVisibility], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *ProductVisibilityRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "product-visibility") 62 | } 63 | 64 | func (t *ProductVisibilityRepository) Upsert(ctx ApiContext, entity []ProductVisibility) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "product_visibility") 66 | } 67 | 68 | func (t *ProductVisibilityRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "product_visibility") 70 | } 71 | 72 | type ProductVisibility struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | Product *Product `json:"product,omitempty"` 79 | 80 | ProductId string `json:"productId,omitempty"` 81 | 82 | ProductVersionId string `json:"productVersionId,omitempty"` 83 | 84 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 85 | 86 | SalesChannelId string `json:"salesChannelId,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | Visibility float64 `json:"visibility,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_seo_url_template.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type SeoUrlTemplateRepository struct { 11 | *GenericRepository[SeoUrlTemplate] 12 | } 13 | 14 | func NewSeoUrlTemplateRepository(client *Client) *SeoUrlTemplateRepository { 15 | return &SeoUrlTemplateRepository{ 16 | GenericRepository: NewGenericRepository[SeoUrlTemplate](client), 17 | } 18 | } 19 | 20 | func (t *SeoUrlTemplateRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[SeoUrlTemplate], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "seo-url-template") 22 | } 23 | 24 | func (t *SeoUrlTemplateRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[SeoUrlTemplate], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *SeoUrlTemplateRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "seo-url-template") 62 | } 63 | 64 | func (t *SeoUrlTemplateRepository) Upsert(ctx ApiContext, entity []SeoUrlTemplate) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "seo_url_template") 66 | } 67 | 68 | func (t *SeoUrlTemplateRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "seo_url_template") 70 | } 71 | 72 | type SeoUrlTemplate struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | CustomFields interface{} `json:"customFields,omitempty"` 77 | 78 | EntityName string `json:"entityName,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | IsValid bool `json:"isValid,omitempty"` 83 | 84 | RouteName string `json:"routeName,omitempty"` 85 | 86 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 87 | 88 | SalesChannelId string `json:"salesChannelId,omitempty"` 89 | 90 | Template string `json:"template,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_product_feature_set.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type ProductFeatureSetRepository struct { 11 | *GenericRepository[ProductFeatureSet] 12 | } 13 | 14 | func NewProductFeatureSetRepository(client *Client) *ProductFeatureSetRepository { 15 | return &ProductFeatureSetRepository{ 16 | GenericRepository: NewGenericRepository[ProductFeatureSet](client), 17 | } 18 | } 19 | 20 | func (t *ProductFeatureSetRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductFeatureSet], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "product-feature-set") 22 | } 23 | 24 | func (t *ProductFeatureSetRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ProductFeatureSet], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *ProductFeatureSetRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "product-feature-set") 62 | } 63 | 64 | func (t *ProductFeatureSetRepository) Upsert(ctx ApiContext, entity []ProductFeatureSet) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "product_feature_set") 66 | } 67 | 68 | func (t *ProductFeatureSetRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "product_feature_set") 70 | } 71 | 72 | type ProductFeatureSet struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Description string `json:"description,omitempty"` 77 | 78 | Features interface{} `json:"features,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | Name string `json:"name,omitempty"` 83 | 84 | Products []Product `json:"products,omitempty"` 85 | 86 | Translated interface{} `json:"translated,omitempty"` 87 | 88 | Translations []ProductFeatureSetTranslation `json:"translations,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_scheduled_task.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type ScheduledTaskRepository struct { 11 | *GenericRepository[ScheduledTask] 12 | } 13 | 14 | func NewScheduledTaskRepository(client *Client) *ScheduledTaskRepository { 15 | return &ScheduledTaskRepository{ 16 | GenericRepository: NewGenericRepository[ScheduledTask](client), 17 | } 18 | } 19 | 20 | func (t *ScheduledTaskRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[ScheduledTask], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "scheduled-task") 22 | } 23 | 24 | func (t *ScheduledTaskRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[ScheduledTask], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *ScheduledTaskRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "scheduled-task") 62 | } 63 | 64 | func (t *ScheduledTaskRepository) Upsert(ctx ApiContext, entity []ScheduledTask) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "scheduled_task") 66 | } 67 | 68 | func (t *ScheduledTaskRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "scheduled_task") 70 | } 71 | 72 | type ScheduledTask struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | DefaultRunInterval float64 `json:"defaultRunInterval,omitempty"` 77 | 78 | Id string `json:"id,omitempty"` 79 | 80 | LastExecutionTime time.Time `json:"lastExecutionTime,omitempty"` 81 | 82 | Name string `json:"name,omitempty"` 83 | 84 | NextExecutionTime time.Time `json:"nextExecutionTime,omitempty"` 85 | 86 | RunInterval float64 `json:"runInterval,omitempty"` 87 | 88 | ScheduledTaskClass string `json:"scheduledTaskClass,omitempty"` 89 | 90 | Status string `json:"status,omitempty"` 91 | 92 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 93 | 94 | } 95 | -------------------------------------------------------------------------------- /repo_country_translation.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type CountryTranslationRepository struct { 11 | *GenericRepository[CountryTranslation] 12 | } 13 | 14 | func NewCountryTranslationRepository(client *Client) *CountryTranslationRepository { 15 | return &CountryTranslationRepository{ 16 | GenericRepository: NewGenericRepository[CountryTranslation](client), 17 | } 18 | } 19 | 20 | func (t *CountryTranslationRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[CountryTranslation], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "country-translation") 22 | } 23 | 24 | func (t *CountryTranslationRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[CountryTranslation], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *CountryTranslationRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "country-translation") 62 | } 63 | 64 | func (t *CountryTranslationRepository) Upsert(ctx ApiContext, entity []CountryTranslation) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "country_translation") 66 | } 67 | 68 | func (t *CountryTranslationRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "country_translation") 70 | } 71 | 72 | type CountryTranslation struct { 73 | 74 | AddressFormat interface{} `json:"addressFormat,omitempty"` 75 | 76 | Country *Country `json:"country,omitempty"` 77 | 78 | CountryId string `json:"countryId,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | CustomFields interface{} `json:"customFields,omitempty"` 83 | 84 | Language *Language `json:"language,omitempty"` 85 | 86 | LanguageId string `json:"languageId,omitempty"` 87 | 88 | Name string `json:"name,omitempty"` 89 | 90 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 91 | 92 | } 93 | -------------------------------------------------------------------------------- /repo_promotion_sales_channel.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type PromotionSalesChannelRepository struct { 11 | *GenericRepository[PromotionSalesChannel] 12 | } 13 | 14 | func NewPromotionSalesChannelRepository(client *Client) *PromotionSalesChannelRepository { 15 | return &PromotionSalesChannelRepository{ 16 | GenericRepository: NewGenericRepository[PromotionSalesChannel](client), 17 | } 18 | } 19 | 20 | func (t *PromotionSalesChannelRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSalesChannel], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "promotion-sales-channel") 22 | } 23 | 24 | func (t *PromotionSalesChannelRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[PromotionSalesChannel], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *PromotionSalesChannelRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "promotion-sales-channel") 62 | } 63 | 64 | func (t *PromotionSalesChannelRepository) Upsert(ctx ApiContext, entity []PromotionSalesChannel) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "promotion_sales_channel") 66 | } 67 | 68 | func (t *PromotionSalesChannelRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "promotion_sales_channel") 70 | } 71 | 72 | type PromotionSalesChannel struct { 73 | 74 | CreatedAt time.Time `json:"createdAt,omitempty"` 75 | 76 | Id string `json:"id,omitempty"` 77 | 78 | Priority float64 `json:"priority,omitempty"` 79 | 80 | Promotion *Promotion `json:"promotion,omitempty"` 81 | 82 | PromotionId string `json:"promotionId,omitempty"` 83 | 84 | SalesChannel *SalesChannel `json:"salesChannel,omitempty"` 85 | 86 | SalesChannelId string `json:"salesChannelId,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | } 91 | -------------------------------------------------------------------------------- /repo_version_commit.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type VersionCommitRepository struct { 11 | *GenericRepository[VersionCommit] 12 | } 13 | 14 | func NewVersionCommitRepository(client *Client) *VersionCommitRepository { 15 | return &VersionCommitRepository{ 16 | GenericRepository: NewGenericRepository[VersionCommit](client), 17 | } 18 | } 19 | 20 | func (t *VersionCommitRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[VersionCommit], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "version-commit") 22 | } 23 | 24 | func (t *VersionCommitRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[VersionCommit], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *VersionCommitRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "version-commit") 62 | } 63 | 64 | func (t *VersionCommitRepository) Upsert(ctx ApiContext, entity []VersionCommit) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "version_commit") 66 | } 67 | 68 | func (t *VersionCommitRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "version_commit") 70 | } 71 | 72 | type VersionCommit struct { 73 | 74 | AutoIncrement float64 `json:"autoIncrement,omitempty"` 75 | 76 | CreatedAt time.Time `json:"createdAt,omitempty"` 77 | 78 | Data []VersionCommitData `json:"data,omitempty"` 79 | 80 | Id string `json:"id,omitempty"` 81 | 82 | IntegrationId string `json:"integrationId,omitempty"` 83 | 84 | IsMerge bool `json:"isMerge,omitempty"` 85 | 86 | Message string `json:"message,omitempty"` 87 | 88 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 89 | 90 | UserId string `json:"userId,omitempty"` 91 | 92 | Version *Version `json:"version,omitempty"` 93 | 94 | VersionId string `json:"versionId,omitempty"` 95 | 96 | } 97 | -------------------------------------------------------------------------------- /repo_app_cms_block.go: -------------------------------------------------------------------------------- 1 | package go_shopware_admin_sdk 2 | 3 | import ( 4 | "net/http" 5 | 6 | "time" 7 | 8 | ) 9 | 10 | type AppCmsBlockRepository struct { 11 | *GenericRepository[AppCmsBlock] 12 | } 13 | 14 | func NewAppCmsBlockRepository(client *Client) *AppCmsBlockRepository { 15 | return &AppCmsBlockRepository{ 16 | GenericRepository: NewGenericRepository[AppCmsBlock](client), 17 | } 18 | } 19 | 20 | func (t *AppCmsBlockRepository) Search(ctx ApiContext, criteria Criteria) (*EntityCollection[AppCmsBlock], *http.Response, error) { 21 | return t.GenericRepository.Search(ctx, criteria, "app-cms-block") 22 | } 23 | 24 | func (t *AppCmsBlockRepository) SearchAll(ctx ApiContext, criteria Criteria) (*EntityCollection[AppCmsBlock], *http.Response, error) { 25 | if criteria.Limit == 0 { 26 | criteria.Limit = 50 27 | } 28 | 29 | if criteria.Page == 0 { 30 | criteria.Page = 1 31 | } 32 | 33 | c, resp, err := t.Search(ctx, criteria) 34 | 35 | if err != nil { 36 | return c, resp, err 37 | } 38 | 39 | for { 40 | criteria.Page++ 41 | 42 | nextC, nextResp, nextErr := t.Search(ctx, criteria) 43 | 44 | if nextErr != nil { 45 | return c, nextResp, nextErr 46 | } 47 | 48 | if len(nextC.Data) == 0 { 49 | break 50 | } 51 | 52 | c.Data = append(c.Data, nextC.Data...) 53 | } 54 | 55 | c.Total = int64(len(c.Data)) 56 | 57 | return c, resp, err 58 | } 59 | 60 | func (t *AppCmsBlockRepository) SearchIds(ctx ApiContext, criteria Criteria) (*SearchIdsResponse, *http.Response, error) { 61 | return t.GenericRepository.SearchIds(ctx, criteria, "app-cms-block") 62 | } 63 | 64 | func (t *AppCmsBlockRepository) Upsert(ctx ApiContext, entity []AppCmsBlock) (*http.Response, error) { 65 | return t.GenericRepository.Upsert(ctx, entity, "app_cms_block") 66 | } 67 | 68 | func (t *AppCmsBlockRepository) Delete(ctx ApiContext, ids []string) (*http.Response, error) { 69 | return t.GenericRepository.Delete(ctx, ids, "app_cms_block") 70 | } 71 | 72 | type AppCmsBlock struct { 73 | 74 | App *App `json:"app,omitempty"` 75 | 76 | AppId string `json:"appId,omitempty"` 77 | 78 | Block interface{} `json:"block,omitempty"` 79 | 80 | CreatedAt time.Time `json:"createdAt,omitempty"` 81 | 82 | Id string `json:"id,omitempty"` 83 | 84 | Label string `json:"label,omitempty"` 85 | 86 | Name string `json:"name,omitempty"` 87 | 88 | Styles string `json:"styles,omitempty"` 89 | 90 | Template string `json:"template,omitempty"` 91 | 92 | Translated interface{} `json:"translated,omitempty"` 93 | 94 | Translations []AppCmsBlockTranslation `json:"translations,omitempty"` 95 | 96 | UpdatedAt time.Time `json:"updatedAt,omitempty"` 97 | 98 | } 99 | --------------------------------------------------------------------------------