|
| 1 | +// This file was automatically generated. DO NOT EDIT. |
| 2 | +// If you have any remark or suggestion do not hesitate to open an issue. |
| 3 | + |
| 4 | +package audit_trail |
| 5 | + |
| 6 | +import ( |
| 7 | + "context" |
| 8 | + "reflect" |
| 9 | + |
| 10 | + "github.com/scaleway/scaleway-cli/v2/core" |
| 11 | + "github.com/scaleway/scaleway-sdk-go/api/audit_trail/v1alpha1" |
| 12 | + "github.com/scaleway/scaleway-sdk-go/scw" |
| 13 | +) |
| 14 | + |
| 15 | +// always import dependencies |
| 16 | +var ( |
| 17 | + _ = scw.RegionFrPar |
| 18 | +) |
| 19 | + |
| 20 | +func GetGeneratedCommands() *core.Commands { |
| 21 | + return core.NewCommands( |
| 22 | + auditTrailRoot(), |
| 23 | + auditTrailEvent(), |
| 24 | + auditTrailProduct(), |
| 25 | + auditTrailEventList(), |
| 26 | + auditTrailProductList(), |
| 27 | + ) |
| 28 | +} |
| 29 | +func auditTrailRoot() *core.Command { |
| 30 | + return &core.Command{ |
| 31 | + Short: `This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.`, |
| 32 | + Long: `This API allows you to ensure accountability and security by recording events and changes performed within your Scaleway Organization.`, |
| 33 | + Namespace: "audit-trail", |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +func auditTrailEvent() *core.Command { |
| 38 | + return &core.Command{ |
| 39 | + Short: `Represent an entry in the Audit Trail`, |
| 40 | + Long: `Represent an entry in the Audit Trail.`, |
| 41 | + Namespace: "audit-trail", |
| 42 | + Resource: "event", |
| 43 | + } |
| 44 | +} |
| 45 | + |
| 46 | +func auditTrailProduct() *core.Command { |
| 47 | + return &core.Command{ |
| 48 | + Short: `Product integrated with Audit Trail`, |
| 49 | + Long: `Product integrated with Audit Trail.`, |
| 50 | + Namespace: "audit-trail", |
| 51 | + Resource: "product", |
| 52 | + } |
| 53 | +} |
| 54 | + |
| 55 | +func auditTrailEventList() *core.Command { |
| 56 | + return &core.Command{ |
| 57 | + Short: `List events`, |
| 58 | + Long: `Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the ` + "`" + `organization_id` + "`" + ` and optionally, the ` + "`" + `project_id` + "`" + `.`, |
| 59 | + Namespace: "audit-trail", |
| 60 | + Resource: "event", |
| 61 | + Verb: "list", |
| 62 | + // Deprecated: false, |
| 63 | + ArgsType: reflect.TypeOf(audit_trail.ListEventsRequest{}), |
| 64 | + ArgSpecs: core.ArgSpecs{ |
| 65 | + { |
| 66 | + Name: "project-id", |
| 67 | + Short: `(Optional) ID of the Project containing the Audit Trail events`, |
| 68 | + Required: false, |
| 69 | + Deprecated: false, |
| 70 | + Positional: false, |
| 71 | + }, |
| 72 | + { |
| 73 | + Name: "resource-type", |
| 74 | + Short: `(Optional) Returns a paginated list of Scaleway resources' features`, |
| 75 | + Required: false, |
| 76 | + Deprecated: false, |
| 77 | + Positional: false, |
| 78 | + EnumValues: []string{"unknown_type", "secm_secret", "secm_secret_version", "kube_cluster", "kube_pool", "kube_node", "kube_acl"}, |
| 79 | + }, |
| 80 | + { |
| 81 | + Name: "method-name", |
| 82 | + Short: `(Optional) Name of the method or the API call performed`, |
| 83 | + Required: false, |
| 84 | + Deprecated: false, |
| 85 | + Positional: false, |
| 86 | + }, |
| 87 | + { |
| 88 | + Name: "status", |
| 89 | + Short: `(Optional) HTTP status code of the request. Returns either ` + "`" + `200` + "`" + ` if the request was successful or ` + "`" + `403` + "`" + ` if the permission was denied`, |
| 90 | + Required: false, |
| 91 | + Deprecated: false, |
| 92 | + Positional: false, |
| 93 | + }, |
| 94 | + { |
| 95 | + Name: "recorded-after", |
| 96 | + Short: `(Optional) The ` + "`" + `recorded_after` + "`" + ` parameter defines the earliest timestamp from which Audit Trail events are retrieved. Returns ` + "`" + `one hour ago` + "`" + ` by default`, |
| 97 | + Required: false, |
| 98 | + Deprecated: false, |
| 99 | + Positional: false, |
| 100 | + }, |
| 101 | + { |
| 102 | + Name: "recorded-before", |
| 103 | + Short: `(Optional) The ` + "`" + `recorded_before` + "`" + ` parameter defines the latest timestamp up to which Audit Trail events are retrieved. Returns ` + "`" + `now` + "`" + ` by default`, |
| 104 | + Required: false, |
| 105 | + Deprecated: false, |
| 106 | + Positional: false, |
| 107 | + }, |
| 108 | + { |
| 109 | + Name: "order-by", |
| 110 | + Required: false, |
| 111 | + Deprecated: false, |
| 112 | + Positional: false, |
| 113 | + EnumValues: []string{"recorded_at_desc", "recorded_at_asc"}, |
| 114 | + }, |
| 115 | + { |
| 116 | + Name: "page-size", |
| 117 | + Required: false, |
| 118 | + Deprecated: false, |
| 119 | + Positional: false, |
| 120 | + }, |
| 121 | + { |
| 122 | + Name: "page-token", |
| 123 | + Required: false, |
| 124 | + Deprecated: false, |
| 125 | + Positional: false, |
| 126 | + }, |
| 127 | + { |
| 128 | + Name: "product-name", |
| 129 | + Short: `(Optional) Name of the Scaleway resource in a hyphenated format`, |
| 130 | + Required: false, |
| 131 | + Deprecated: false, |
| 132 | + Positional: false, |
| 133 | + }, |
| 134 | + core.OrganizationIDArgSpec(), |
| 135 | + core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), |
| 136 | + }, |
| 137 | + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { |
| 138 | + request := args.(*audit_trail.ListEventsRequest) |
| 139 | + |
| 140 | + client := core.ExtractClient(ctx) |
| 141 | + api := audit_trail.NewAPI(client) |
| 142 | + return api.ListEvents(request) |
| 143 | + |
| 144 | + }, |
| 145 | + } |
| 146 | +} |
| 147 | + |
| 148 | +func auditTrailProductList() *core.Command { |
| 149 | + return &core.Command{ |
| 150 | + Short: `Retrieve the list of Scaleway resources for which you have Audit Trail events`, |
| 151 | + Long: `Retrieve the list of Scaleway resources for which you have Audit Trail events.`, |
| 152 | + Namespace: "audit-trail", |
| 153 | + Resource: "product", |
| 154 | + Verb: "list", |
| 155 | + // Deprecated: false, |
| 156 | + ArgsType: reflect.TypeOf(audit_trail.ListProductsRequest{}), |
| 157 | + ArgSpecs: core.ArgSpecs{ |
| 158 | + core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), |
| 159 | + }, |
| 160 | + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { |
| 161 | + request := args.(*audit_trail.ListProductsRequest) |
| 162 | + |
| 163 | + client := core.ExtractClient(ctx) |
| 164 | + api := audit_trail.NewAPI(client) |
| 165 | + return api.ListProducts(request) |
| 166 | + |
| 167 | + }, |
| 168 | + } |
| 169 | +} |
0 commit comments