| 364 | } |
| 365 | |
| 366 | func buildUpdateItem(config editItemConfig, date time.Time) (*UpdateProjectV2FieldValue, map[string]any) { |
| 367 | var value githubv4.ProjectV2FieldValue |
| 368 | if config.opts.text != "" { |
| 369 | value = githubv4.ProjectV2FieldValue{ |
| 370 | Text: new(githubv4.String(config.opts.text)), |
| 371 | } |
| 372 | } else if config.opts.numberChanged { |
| 373 | value = githubv4.ProjectV2FieldValue{ |
| 374 | Number: new(githubv4.Float(config.opts.number)), |
| 375 | } |
| 376 | } else if config.opts.date != "" { |
| 377 | value = githubv4.ProjectV2FieldValue{ |
| 378 | Date: new(githubv4.Date{Time: date}), |
| 379 | } |
| 380 | } else if config.opts.singleSelectOptionID != "" { |
| 381 | value = githubv4.ProjectV2FieldValue{ |
| 382 | SingleSelectOptionID: new(githubv4.String(config.opts.singleSelectOptionID)), |
| 383 | } |
| 384 | } else if config.opts.iterationID != "" { |
| 385 | value = githubv4.ProjectV2FieldValue{ |
| 386 | IterationID: new(githubv4.String(config.opts.iterationID)), |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | return &UpdateProjectV2FieldValue{}, map[string]any{ |
| 391 | "input": githubv4.UpdateProjectV2ItemFieldValueInput{ |
| 392 | ProjectID: githubv4.ID(config.opts.projectID), |
| 393 | ItemID: githubv4.ID(config.opts.itemID), |
| 394 | FieldID: githubv4.ID(config.opts.fieldID), |
| 395 | Value: value, |
| 396 | }, |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | func buildClearItem(config editItemConfig) (*ClearProjectV2FieldValue, map[string]any) { |
| 401 | return &ClearProjectV2FieldValue{}, map[string]any{ |