( cmd *cobra.Command, flags networkUpdateChannelFlags, )
| 352 | } |
| 353 | |
| 354 | func networkChannelUpdateRequest( |
| 355 | cmd *cobra.Command, |
| 356 | flags networkUpdateChannelFlags, |
| 357 | ) (UpdateNetworkChannelRequest, error) { |
| 358 | request := UpdateNetworkChannelRequest{} |
| 359 | if cmd.Flags().Changed("purpose") { |
| 360 | value := strings.TrimSpace(flags.purpose) |
| 361 | request.Purpose = &value |
| 362 | } |
| 363 | if cmd.Flags().Changed("fanout-policy") { |
| 364 | value := strings.TrimSpace(flags.fanoutPolicy) |
| 365 | request.FanoutPolicy = &value |
| 366 | } |
| 367 | if cmd.Flags().Changed("coordinator-peer-id") { |
| 368 | value := strings.TrimSpace(flags.coordinatorPeerID) |
| 369 | request.CoordinatorPeerID = &value |
| 370 | } |
| 371 | if request.Purpose == nil && request.FanoutPolicy == nil && request.CoordinatorPeerID == nil { |
| 372 | return UpdateNetworkChannelRequest{}, errors.New( |
| 373 | "cli: at least one of --purpose, --fanout-policy, or --coordinator-peer-id is required", |
| 374 | ) |
| 375 | } |
| 376 | return request, nil |
| 377 | } |
| 378 | |
| 379 | func resolveNetworkCreateChannelName(args []string, channelFlag string) (string, error) { |
| 380 | fromArg := "" |
no outgoing calls
no test coverage detected