Documentation ¶
Index ¶
Constants ¶
View Source
const ( NameKey = "name" NameShorthand = "n" ImageURLKey = "image-url" )
Variables ¶
View Source
var UpdateOrganizationCmd = &cobra.Command{ Use: "update <organization-id>", Short: "Update an organization", Args: cobra.ExactArgs(1), SilenceUsage: true, RunE: func(_ *cobra.Command, args []string) error { ctxTimeout, cancel := context.WithTimeout(context.Background(), config.DefaultTimeout) defer cancel() c, err := cloudclient.NewClient(ctxTimeout) if err != nil { return err } id := args[0] r, err := c.UpdateOrganizationMutationWithResponse(ctxTimeout, id, cloudapi.UpdateOrganizationMutationJSONRequestBody{ Name: lo.Ternary(viper.IsSet(NameKey), lo.ToPtr(viper.GetString(NameKey)), nil), ImageURL: lo.Ternary(viper.IsSet(ImageURLKey), lo.ToPtr(viper.GetString(ImageURLKey)), nil), }, ) if err != nil { return err } prints.PrintCliStderr("Organization updated") output.FormatOrganizations([]cloudapi.Organization{lo.FromPtr(r.JSON200)}) return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.