def METHOD_NAME(client,
                                  resource_group_name,
                                  provider_name,
                                  resource_type,
                                  resource_name,
                                  configuration_assignment_name,
                                  location=None,
                                  maintenance_configuration_id=None,
                                  resource_id=None):
    configuration_assignment = {}
    if location is not None:
        configuration_assignment['location'] = location
    if maintenance_configuration_id is not None:
        configuration_assignment['maintenance_configuration_id'] = maintenance_configuration_id
    if resource_id is not None:
        configuration_assignment['resource_id'] = resource_id
    return client.create_or_update(resource_group_name=resource_group_name,
                                   provider_name=provider_name,
                                   resource_type=resource_type,
                                   resource_name=resource_name,
                                   configuration_assignment_name=configuration_assignment_name,
                                   configuration_assignment=configuration_assignment)