def setPaginationConsistentWith()

in client/src/main/scala/com.gu.contentapi.client/model/Queries.scala [97:115]


  def setPaginationConsistentWith(response: SearchResponse): PaginatedApiQuery[SearchResponse, Content] =
    pageSize.setIfUndefined(response.pageSize).orderBy.setIfUndefined(response.orderBy)

  def withParameters(parameterMap: Map[String, Parameter]): SearchQuery = copy(parameterMap, channelId)

  /**
    * Make this search on a CAPI channel rather than against web-only content
    * For more information about channels, and the reason why your app should only be in one channel,
    * contact the Content API team
    * @param channelId the channel to search against, or "all" to search across all channels.
    */
  def withChannel(channelId:String):SearchQuery = copy(parameterHolder, Some(channelId))

  def withoutChannel(): SearchQuery = copy(parameterHolder, None)

  override def pathSegment: String = channelId match {
    case None=>"search"
    case Some(chnl)=>s"channel/$chnl/search"
  }