(opts *EnableOptions)
| 47 | } |
| 48 | |
| 49 | func enableRun(opts *EnableOptions) error { |
| 50 | if !opts.NoPrompt { |
| 51 | if err := PromptMissing(opts); err != nil { |
| 52 | return err |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | if opts.IdOrName == "" { |
| 57 | return fmt.Errorf("tenant identifier is required but was not provided") |
| 58 | } |
| 59 | |
| 60 | tenantToUpdate, err := opts.Client.Tenants.GetByIdentifier(opts.IdOrName) |
| 61 | if err != nil { |
| 62 | return err |
| 63 | } |
| 64 | |
| 65 | tenantToUpdate.IsDisabled = false |
| 66 | _, err = tenants.Update(opts.Client, tenantToUpdate) |
| 67 | if err != nil { |
| 68 | return err |
| 69 | } |
| 70 | |
| 71 | return nil |
| 72 | } |
| 73 | |
| 74 | func PromptMissing(opts *EnableOptions) error { |
| 75 | if opts.IdOrName == "" { |
no test coverage detected