Skip to content

update_campaign

update_campaign(
    name: campaignName,
    action: UpdateCampaignAction,
    *,
    config_overrides: Optional[IoTFleetWiseClientConfig] = None,
    description: Optional[description] = None,
    data_extra_dimensions: Optional[DataExtraDimensionNodePathList] = None,
) -> UpdateCampaignResponse

Updates a campaign.

Parameters:

  • name (campaignName) –

    The name of the campaign to update.

  • description (Optional[description], default: None ) –

    The description of the campaign.

  • data_extra_dimensions (Optional[DataExtraDimensionNodePathList], default: None ) –

    A list of vehicle attributes to associate with a signal.

    Default: An empty array

  • action (UpdateCampaignAction) –

    Specifies how to update a campaign. The action can be one of the following:

    • APPROVE - To approve delivering a data collection scheme to vehicles.

    • SUSPEND - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.

    • RESUME - To reactivate the SUSPEND campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.

    • UPDATE - To update a campaign.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/io_t_fleet_wise.py
def update_campaign(
    self,
    name: "capo_iotfleetwise.types.campaign_name.campaignName",
    action: "capo_iotfleetwise.types.update_campaign_action.UpdateCampaignAction",
    *,
    config_overrides: Optional[IoTFleetWiseClientConfig] = None,
    description: Optional["capo_iotfleetwise.types.description.description"] = None,
    data_extra_dimensions: Optional[
        "capo_iotfleetwise.types.data_extra_dimension_node_path_list.DataExtraDimensionNodePathList"
    ] = None,
) -> "capo_iotfleetwise.types.update_campaign_response.UpdateCampaignResponse":
    """<p> Updates a campaign. </p>

    Args:
        name: <p> The name of the campaign to update. </p>
        description: <p>The description of the campaign.</p>
        data_extra_dimensions: <p> A list of vehicle attributes to associate with a signal. </p> <p>Default: An empty array</p>
        action: <p> Specifies how to update a campaign. The action can be one of the following:</p> <ul> <li> <p> <code>APPROVE</code> - To approve delivering a data collection scheme to vehicles. </p> </li> <li> <p> <code>SUSPEND</code> - To suspend collecting signal data. The campaign is deleted from vehicles and all vehicles in the suspended campaign will stop sending data.</p> </li> <li> <p> <code>RESUME</code> - To reactivate the <code>SUSPEND</code> campaign. The campaign is redeployed to all vehicles and the vehicles will resume sending data.</p> </li> <li> <p> <code>UPDATE</code> - To update a campaign. </p> </li> </ul>

    Raises:
        capo_iotfleetwise.errors.internal_server_exception.InternalServerException: <p>The request couldn't be completed because the server temporarily failed.</p>
        capo_iotfleetwise.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_iotfleetwise.errors.conflict_exception.ConflictException: <p>The request has conflicting operations. This can occur if you're trying to perform more than one operation on the same resource at the same time.</p>
        capo_iotfleetwise.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource wasn't found.</p>
        capo_iotfleetwise.errors.throttling_exception.ThrottlingException: <p>The request couldn't be completed due to throttling.</p>
        capo_iotfleetwise.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_iotfleetwise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iotfleetwise.types.update_campaign_request.UpdateCampaignRequest]",
    ) -> OperationResponse[
        "capo_iotfleetwise.types.update_campaign_response.UpdateCampaignResponse"
    ]:
        import capo_iotfleetwise._operations.io_t_autobahn_control_plane.update_campaign

        output, http_response = (
            capo_iotfleetwise._operations.io_t_autobahn_control_plane.update_campaign.update_campaign(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_iotfleetwise.types.update_campaign_request.UpdateCampaignRequest",
    ) -> dict[str, Any]:
        import capo_iotfleetwise.types.update_campaign_request

        return capo_iotfleetwise.types.update_campaign_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateCampaign", redact_input=_redact_input),
    )
    input_: capo_iotfleetwise.types.update_campaign_request.UpdateCampaignRequest = {
        "name": name,
        "action": action,
    }
    if description is not None:
        input_["description"] = description
    if data_extra_dimensions is not None:
        input_["data_extra_dimensions"] = data_extra_dimensions

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output