openstackid-resources/app/ModelSerializers/Summit/ScheduledSummitLocationBannerSerializer.php
Sebastian Marcet dda0d68378 added new endpoint add location banner
POST /api/v1/summits/{id}/locations/{location_id}/banners
Payload

* title (required|string)
* content (required|string)
* type (required|in:Primary,Secondary)
* enabled (required|boolean)
* class_name (required|in:SummitLocationBanner, ScheduledSummitLocationBanner)

Payload part for ScheduledSummitLocationBanner

* start_date (required|date_format:U)
* end_date (required_with:start_date|date_format:U|after:start_date)

Required Scopes

* '%s/summits/write'
* '%s/locations/write'
* '%s/locations/banners/write'

Change-Id: Ic8de4a81c4d57253bbe25559a5ba7f50d1c7730d
2018-03-07 19:07:51 -03:00

26 lines
981 B
PHP

<?php namespace App\ModelSerializers\Summit;
/**
* Copyright 2018 OpenStack Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
/**
* Class ScheduledSummitLocationBannerSerializer
* @package App\ModelSerializers\Summit
*/
final class ScheduledSummitLocationBannerSerializer extends SummitLocationBannerSerializer
{
protected static $array_mappings = [
'StartDate' => 'start_date:datetime_epoch',
'EndDate' => 'end_date:datetime_epoch',
];
}