assignAddProjectHookOptions assigns the flags' values to gitlab.AddProjectHookOptions fields. If a flag's default value is not changed by the caller, it's value will not be assigned to the associated gitlab.AddProjectHookOptions field.
(cmd *cobra.Command)
| 193 | // If a flag's default value is not changed by the caller, |
| 194 | // it's value will not be assigned to the associated gitlab.AddProjectHookOptions field. |
| 195 | func assignAddProjectHookOptions(cmd *cobra.Command) (*gitlab.AddProjectHookOptions, error) { |
| 196 | opts := new(gitlab.AddProjectHookOptions) |
| 197 | if cmd.Flag("url").Changed { |
| 198 | opts.URL = gitlab.String(getFlagString(cmd, "url")) |
| 199 | } |
| 200 | if cmd.Flag("push-events").Changed { |
| 201 | opts.PushEvents = gitlab.Bool(getFlagBool(cmd, "push-events")) |
| 202 | } |
| 203 | if cmd.Flag("issues-events").Changed { |
| 204 | opts.IssuesEvents = gitlab.Bool(getFlagBool(cmd, "issues-events")) |
| 205 | } |
| 206 | if cmd.Flag("confidential-issues-events").Changed { |
| 207 | opts.ConfidentialIssuesEvents = gitlab.Bool(getFlagBool(cmd, "confidential-issues-events")) |
| 208 | } |
| 209 | if cmd.Flag("merge-requests-events").Changed { |
| 210 | opts.MergeRequestsEvents = gitlab.Bool(getFlagBool(cmd, "merge-requests-events")) |
| 211 | } |
| 212 | if cmd.Flag("tag-push-events").Changed { |
| 213 | opts.TagPushEvents = gitlab.Bool(getFlagBool(cmd, "tag-push-events")) |
| 214 | } |
| 215 | if cmd.Flag("note-events").Changed { |
| 216 | opts.NoteEvents = gitlab.Bool(getFlagBool(cmd, "note-events")) |
| 217 | } |
| 218 | if cmd.Flag("job-events").Changed { |
| 219 | opts.JobEvents = gitlab.Bool(getFlagBool(cmd, "job-events")) |
| 220 | } |
| 221 | if cmd.Flag("pipeline-events").Changed { |
| 222 | opts.PipelineEvents = gitlab.Bool(getFlagBool(cmd, "pipeline-events")) |
| 223 | } |
| 224 | if cmd.Flag("wiki-page-events").Changed { |
| 225 | opts.WikiPageEvents = gitlab.Bool(getFlagBool(cmd, "wiki-page-events")) |
| 226 | } |
| 227 | if cmd.Flag("enable-ssl-verification").Changed { |
| 228 | opts.EnableSSLVerification = gitlab.Bool(getFlagBool(cmd, "enable-ssl-verification")) |
| 229 | } |
| 230 | if cmd.Flag("token").Changed { |
| 231 | opts.Token = gitlab.String(getFlagString(cmd, "token")) |
| 232 | } |
| 233 | return opts, nil |
| 234 | } |
| 235 | |
| 236 | // assignListUsersOptions assigns the flags' values to gitlab.ListUsersOptions fields. |
| 237 | // If a flag's default value is not changed by the caller, |
no test coverage detected