text:
package apigee

import (
	"encoding/json"
	"net/http"
	"net/http/httptest"
	"net/url"
	"strings"
	"testing"
)

func cacheTestServer(t *testing.T) *httptest.Server {
	m := http.NewServeMux()

	cache := Cache{
		Name:        "cache-1",
		Description: "cache 1",
	}

	m.HandleFunc("/", (func(w http.ResponseWriter, r *http.Request) {
		switch r.Method {
		case http.MethodGet:
			if strings.Contains(r.URL.Path, "cache-2") {
				w.WriteHeader(http.StatusNotFound)
				return
			}
			w.Header().Set("Content-Type", "application/json")
			if err := json.NewEncoder(w).Encode(cache); err != nil {
				t.Fatalf("want no error %v", err)
			}
		case http.MethodPost:
			w.WriteHeader(http.StatusCreated)
			_, _ = w.Write([]byte("{}"))
		default:
			w.WriteHeader(http.StatusMethodNotAllowed)
		}
	}))
	return httptest.NewServer(m)
}

func TestGetCache(t *testing.T) {
	ts := cacheTestServer(t)
	defer ts.Close()
	baseUrl, err := url.Parse(ts.URL)
	if err != nil {
		t.Fatal(err)
	}
	client := &EdgeClient{
		client:     http.DefaultClient,
		BaseURLEnv: baseUrl,
		BaseURL:    baseUrl,
	}
	cs := &CacheServiceOp{
		client: client,
	}

	cache, _, err := cs.Get("cache-1")
	if err != nil {
		t.Error(err)
	}
	if cache.Name != "cache-1" {
		t.Errorf("want cache-1 got %s", cache.Name)
	}

	_, _, err = cs.Get("cache-2")
	if err == nil {
		t.Error("want error got none")
	}
}

func TestCreateCache(t *testing.T) {
	ts := cacheTestServer(t)
	defer ts.Close()
	baseUrl, err := url.Parse(ts.URL)
	if err != nil {
		t.Fatal(err)
	}
	client := &EdgeClient{
		client:     http.DefaultClient,
		BaseURLEnv: baseUrl,
		BaseURL:    baseUrl,
		debug:      true,
	}
	cs := &CacheServiceOp{
		client: client,
	}

	cache := Cache{
		Name:        "cache-1",
		Description: "cache 1",
	}

	_, err = cs.Create(cache)
	if err != nil {
		t.Error(err)
	}
}


text:
import { Page } from '../book';
import { prefixer, div, ElementWrapper } from '../dom';
import padPages from './padPages';

const renderFlipbookViewer = (bookPages: ElementWrapper[], doubleSided: boolean) => {
  const pages = padPages(bookPages, () => new Page());

  const flipLayout = document.createDocumentFragment();
  const sizer = div('.flipbook-sizer');
  const flapHolder = div('.spread-size.flap-holder');
  sizer.append(flapHolder);
  flipLayout.append(sizer);

  const flaps: HTMLElement[] = [];

  let currentLeaf = -1;

  let leftOffset = 4;
  if (pages.length * leftOffset > 60) {
    leftOffset = 60 / pages.length;
  }
  flapHolder.style.width = `${pages.length * leftOffset}px`;

  const setLeaf = (unclamped: number) => {
    let n = unclamped;
    if (n === currentLeaf) n += 1;
    const newLeaf = Math.min(Math.max(0, n), flaps.length);

    let zScale = 4;
    if (flaps.length * zScale > 200) zScale = 200 / flaps.length;

    flaps.forEach((flap, i, arr) => {
      // + 0.5 so left and right are even
      const z = (arr.length - Math.abs(i - newLeaf + 0.5)) * zScale;
      flap.style.transform = `translate3d(${
        i < newLeaf ? 4 : 0
      }px,0,${z}px) rotateY(${i < newLeaf ? -180 : 0}deg)`;
    });

    currentLeaf = newLeaf;
  };

  let leafIndex = 0;
  for (let i = 1; i < pages.length - 1; i += doubleSided ? 2 : 1) {
    leafIndex += 1;
    const li = leafIndex;
    const flap = div('.page3d');

    flap.addEventListener('click', () => {
      const newLeaf = li - 1;
      setLeaf(newLeaf);
    });

    const rightPage = pages[i].element;
    let leftPage;
    rightPage.classList.add(prefixer('page3d-front'));
    flap.append(rightPage);
    if (doubleSided) {
      flap.classList.add(prefixer('doubleSided'));
      leftPage = pages[i + 1].element;
    } else {
      leftPage = div('.page');
    }
    leftPage.classList.add(prefixer('page3d-back'));
    flap.append(leftPage);

    // TODO: Virtualize stack of pages.
    // Putting 1000s of elements onscreen,
    // espacially as 3d layers, locks up the browser.

    flap.style.left = `${i * leftOffset}px`;

    flaps.push(flap);
    flapHolder.append(flap);
  }

  setLeaf(0);
  return {
    element: flipLayout,
    contentSizer: sizer,
    next: () => setLeaf(currentLeaf + 1),
    previous: () => setLeaf(currentLeaf - 1),
  }
};

export { renderFlipbookViewer };

redpajama_set_name: RedPajamaGithub


text:
var Dispatch = require('../../sra/src/util/dispatch.js');
var Actor = require('./actor.js');
var Geometry = require('../../sra/src/util/geometry.js');

var Game = function (server, updateRate) {
	this.server = server;
	this.updateRate = updateRate;
	this.runLoop = new Dispatch.RunLoop(updateRate, this.update, this);

	this.fieldSize = {width: 600, height: 400};
	this.wrapAroundThreshold = 20;

	this.maxAsteroidsByPlayersCount = [8, 8, 7, 7, 6, 6];
	this.lastAsteroidSpawnTime = 0;
	this.asteroidRespawnTime = 3000; // in milliseconds

	this.runLoop.start();
}

Game.prototype.update = function (context) {
	var self = context;

	self.updateGame();
	self.server.updateClients();
	self.server.updateActors();
	self.server.send();
}

Game.prototype.toMessage = function () {
	return {
		w: this.fieldSize.width,
		h: this.fieldSize.height,
		ur: this.updateRate
	};
}

Game.prototype.updateGame = function () {
	this.checkPlayerPlayerCollisions();
	this.checkPlayerBulletCollisions();
	this.checkPlayerAsteroidCollisions();
	this.checkBulletAsteroidCollisions();
	this.checkAsteroidAsteroidCollisions();
	this.updateAsteroids();
}

Game.prototype.updateAsteroids = function () {
	var asteroids = this.server.getActors(Actor.Types.ASTEROID);
	var now = Date.now();

	for (var i = 0, l = asteroids.length; i < l; i++) {
		var asteroid = asteroids[i];

		if (asteroid.alive || asteroid.split || !asteroid.subtype) {
			continue;
		}

		asteroid.split = true;

		var diagonal = asteroid.diagonal;
		var r1 = Math.random() * Math.PI;
		var r2 = Math.random() * Math.PI;
		var direction = new Geometry.Vector2(1.0, 0.0).rotate(r1);
		var offset = direction.times(diagonal / 4.0);

		this.server.addActor(Actor.AsteroidActor, {
			subtype: asteroid.subtype - 1,
			color: asteroid.color,
			rotation: r1,
			x: asteroid.position.x + offset.x,
			y: asteroid.position.y + offset.y,
			direction: direction
		});

		this.server.addActor(Actor.AsteroidActor, {
			subtype: asteroid.subtype - 1,
			color: asteroid.color,
			rotation: r2,
			x: asteroid.position.x - offset.x,
			y: asteroid.position.y - offset.y,
			direction: direction.opposite()
		});

		this.lastAsteroidSpawnTime = now;
	}

	asteroids = this.server.getActors(Actor.Types.ASTEROID);

	if (asteroids.length <= this.maxAsteroidsByPlayersCount[this.server.numberOfClients] &&
		now - this.lastAsteroidSpawnTime >= this.asteroidRespawnTime) {
		this.server.addActor(Actor.AsteroidActor, {subtype: Math.round(Math.random() * Actor.AsteroidActor.maxSubtype)});
		this.lastAsteroidSpawnTime = now;
	}
}

Game.prototype.checkAsteroidAsteroidCollisions = function () {
	var asteroidActors = this.server.getActors(Actor.Types.ASTEROID);

	for (var i = 0, l = asteroidActors.length; i < l; i++) {
		var a1 = asteroidActors[i];

		if (!asteroidIsCollidable(a1)) {
			continue;
		}

		var a2 = this.collisionActorForActor(asteroidActors, i + 1, a1, asteroidIsCollidable);

		if (a2) {
			a1.hit(a2.damage);
			a2.hit(a1.damage);
		}
	}
}

Game.prototype.checkBulletAsteroidCollisions = function () {
	var bulletActors = this.server.getActors(Actor.Types.BULLET);
	var asteroidActors = this.server.getActors(Actor.Types.ASTEROID);

	if (!asteroidActors.length) {
		return;
	}

	for (var i = 0, length = bulletActors.length; i < length; i++) {
		var b = bulletActors[i];

		if (!bulletIsCollidable(b)) {
			continue;
		}

		var a = this.collisionActorForActor(asteroidActors, 0, b, asteroidIsCollidable);

		if (a) {
			b.destroy();
			a.hit(b.damage);
		}
	}
}

Game.prototype.checkPlayerAsteroidCollisions = function () {
	var playerActors = this.server.getActors(Actor.Types.PLAYER);
	var asteroidActors = this.server.getActors(Actor.Types.ASTEROID);

	if (!asteroidActors.length) {
		return;
	}

	for (var i = 0, length = playerActors.length; i < length; i++) {
		var p = playerActors[i];

		if (!playerIsCollidable(p)) {
			continue;
		}

		var a = this.collisionActorForActor(asteroidActors, 0, p, asteroidIsCollidable);

		if (a) {
			p.hit(a.damage);
			a.hit(p.damage);
		}
	}
}

Game.prototype.checkPlayerBulletCollisions = function () {
	var playerActors = this.server.getActors(Actor.Types.PLAYER);
	var bulletActors = this.server.getActors(Actor.Types.BULLET);

	if (!bulletActors.length) {
		return;
	}

	for (var i = 0, length = playerActors.length; i < length; i++) {
		var p = playerActors[i];

		if (!playerIsCollidable(p)) {
			continue;
		}

		var b = this.collisionActorForActor(bulletActors, 0, p, playerBulletIsCollidable);

		if (b) {
			b.destroy();
			p.hit(b.damage);
		}
	}
}

Game.prototype.checkPlayerPlayerCollisions = function () {
	var playerActors = this.server.getActors(Actor.Types.PLAYER);

	for (var i = 0, length = playerActors.length; i < length; i++) {
		var a1 = playerActors[i];

		if (!playerIsCollidable(a1)) {
			continue;
		}

		var a2 = this.collisionActorForActor(playerActors, i + 1, a1, playerIsCollidable);

		if (a2) {
			a1.hit(a2.damage);
			a2.hit(a1.damage);
		}
	}
}

Game.prototype.collisionActorForActor = function (actors, index, actor, validate) {
	var polygon = actor.polygon;

	for (var i = index, l = actors.length; i < l; i++) {
		var a = actors[i];

		if (validate && !validate(a, actor)) {
			continue;
		}

		if (polygon.intersects(a.polygon)) {
			return a;
		}
	}

	return null;
}

Game.prototype.wrapPosition = function (actor) {
	var threshold = actor.diagonal / 2.0;
	var w = this.fieldSize.width;
	var h = this.fieldSize.height;

	if (actor.position.x > w + threshold) {
		actor.position.x -= w + (threshold * 2.0);
	} else if (actor.position.x < -threshold) {
		actor.position.x += w + (threshold * 2.0);
	}

	if (actor.position.y > h + threshold) {
		actor.position.y -= h + (threshold * 2.0);
	} else if (actor.position.y < -threshold) {
		actor.position.y += h + (threshold * 2.0);
	}
}

Game.prototype.positionPlayerOnField = function (player) {
	var startX = player.width / 2.0;
	var startY = player.height / 2.0;
	var fieldWidth = this.fieldSize.width - (2.0 * player.width);
	var fieldHeight = this.fieldSize.height - (2.0 * player.height);
	var allPlayers = this.server.getActors(Actor.Types.PLAYER);
	var allAsteroids = this.server.getActors(Actor.Types.ASTEROID);
	var x, y, r;

	do {
		x = startX + Math.round(Math.random() * fieldWidth);
		y = startY + Math.round(Math.random() * fieldHeight);
		r = Math.random() * (Math.PI * 2.0);
		player.polygon.transform(x, y, r);
	} while (this.collisionActorForActor(allPlayers, 0, player, actorIsOverlappable) ||
			 this.collisionActorForActor(allAsteroids, 0, player, actorIsOverlappable));

	player.position.x = x;
	player.position.y = y;
	player.rotation = r;
}

Game.prototype.positionAsteroidOnField = function (asteroid) {
	var diagonal = asteroid.diagonal;
	var minX = -(diagonal / 2.0);
	var minY = minX;
	var fieldWidth = this.fieldSize.width + diagonal;
	var fieldHeight = this.fieldSize.height + diagonal;
	var allPlayers = this.server.getActors(Actor.Types.PLAYER);
	var allAsteroids = this.server.getActors(Actor.Types.ASTEROID);
	var x, y, r;

	do {
		if (Math.random() % 2) {
			x = minX;
			y = minY + (Math.random() * fieldHeight);
		} else {
			x = minX + (Math.random() * fieldWidth);
			y = minY;
		}

		r = Math.random() * (Math.PI * 2.0);
		asteroid.polygon.transform(x, y, r);
	} while (this.collisionActorForActor(allPlayers, 0, asteroid, actorIsOverlappable) ||
			 this.collisionActorForActor(allAsteroids, 0, asteroid, actorIsOverlappable));

	asteroid.position.x = x;
	asteroid.position.y = y;
	asteroid.rotation = r;
}

// utility
function asteroidIsCollidable(asteroid) {
	return asteroid.alive;
}

function playerIsCollidable(player) {
	return player.alive && !player.invincible;
}

function playerBulletIsCollidable(bullet, player) {
	return bullet.alive && bullet.owner.id != player.id;
}

function bulletIsCollidable(bullet) {
	return bullet.alive;
}

function actorIsOverlappable(actor) {
	return !actor.alive;
}

module.exports = Game;


text:
module CachesMethod
  def self.included(base)
    base.extend ClassMethods
  end

  module ClassMethods
    def caches_method(method, cache_options = {})
      alias_method "uncached_#{method}", method

      define_method method do |*args|
        key = cache_key + "/#{method}/#{args}"
        result = Rails.cache.read(key)
        return result if result

        result = send("uncached_#{method}", *args)
        Rails.cache.write(key, result, cache_options)
        result
      end
    end
  end
end

ActiveRecord::Base.send(:include, CachesMethod)


text:
Rails.application.routes.draw do
  namespace :api do
    resources :characters
    resources :works
    resources :quotes
  end
end


text:
'''
 Unit tests for oo_filters
'''
import os
import sys

MODULE_PATH = os.path.realpath(os.path.join(__file__, os.pardir, os.pardir, 'filter_plugins'))
sys.path.insert(0, MODULE_PATH)

# pylint: disable=import-error,wrong-import-position,missing-docstring
import oo_filters   # noqa: E402

def test_lib_utils_oo_oreg_image():
    default_url = "quay.io/coreos/etcd:v99"

    oreg_url = "None"
    output_image = oo_filters.lib_utils_oo_oreg_image(default_url, oreg_url)
    assert output_image == default_url

    oreg_url = "example.com/openshift/origin-${component}:${version}"
    expected_output = "example.com/coreos/etcd:v99"
    output_image = oo_filters.lib_utils_oo_oreg_image(default_url, oreg_url)
    assert output_image == expected_output

    oreg_url = "example.com/subdir/openshift/origin-${component}:${version}"
    expected_output = "example.com/subdir/coreos/etcd:v99"
    output_image = oo_filters.lib_utils_oo_oreg_image(default_url, oreg_url)
    assert output_image == expected_output

def main():
    test_lib_utils_oo_oreg_image()

if __name__ == '__main__':
    main()


text:
<?php

class Types_Information_Message {

	protected $id;
	protected $type = false;
	protected $conditions = array();

	public $priority;
	public $title;
	public $description;

	/**
	 * Type Set & Get
	 * @param $type
	 */
	public function set_id( $id ) {
		$this->id = $id;
	}

	public function get_id() {
		return $this->id;
	}

	/**
	 * Type Set & Get
	 * @param $type
	 */
	public function set_type( $type ) {
		switch( $type ) {
			case 'information':
			case 'template':
			case 'archive':
			case 'views':
			case 'forms':
				$this->type = $type;
				break;
		}
	}

	public function get_type() {
		return $this->type;
	}

	/**
	 * Use this to add multiple conditions at ounce.
	 *
	 * @param $conditions
	 *
	 * @return bool
	 */
	public function add_conditions( $conditions ) {
		if( $conditions === false )
			return false;

		if( is_array( $conditions ) ) {
			foreach( $conditions as $condition ) {
				$this->add_condition( $condition );
			}
		} else {
			$this->add_condition( $conditions );
		}
	}

	/**
	 * Add a condition to show the message.
	 *
	 * @param Types_Helper_Condition $condition
	 *
	 * @return bool
	 */
	public function add_condition( $condition ) {
		if( $condition = Types_Helper_Type_Hinting::valid( $condition, 'Types_Helper_Condition' ) )
			$this->conditions[] = $condition;

		return $this;
	}

	/**
	 * Check if all assigned conditions match
	 *
	 * @return bool
	 */
	public function valid() {

		foreach( $this->conditions as $condition ) {
			if( ! $condition->valid() )
				return false;
		}

		return true;
	}

	/**
	 * Title Set & Get
	 * @param $title
	 */
	public function set_title( $title ) {
		$this->title = $title;
	}

	public function get_title() {
		return $this->title;
	}

	/**
	 * Description Set & Get
	 * @param $description
	 */
	public function set_description( $description ) {
		if( !is_array( $description ) ) {
			$this->description = array(
				array(
					'type' => 'paragraph',
					'content' => $description
				)
			);

			return;
		}

		// @todo Remove once placeholder replace comes before Twig rendering
		foreach( $description as &$element ) {
			if( isset( $element['target'] ) ) {
				switch( $element['target'] ) {
					case '%POST-PERMALINK%':
						$element['target'] = Types_Helper_Placeholder::get_permalink();
						break;
					case '%POST-ARCHIVE-PERMALINK%':
						$element['target'] = Types_Helper_Placeholder::get_archive_permalink();
						break;
				}
			}

		}

		$this->description = $description;
	}

	public function get_description() {
		return $this->description;
	}

	/**
	 * Import data
	 * see /application/data/information
	 *
	 * @param array $data
	 *
	 * @return bool
	 */
	public function data_import( $data ) {
		if( ! is_array( $data ) )
			return false;

		$default = array(
			'id'            => false,
			'type'          => false,
			'conditions'    => false,
			'title'         => false,
			'description'   => false,
			'priority'      => false
		);

		$cfg = array_replace_recursive( $default, $data );

		$this->set_id( $cfg['id'] );
		$this->set_type( $cfg['type'] );
		$this->add_conditions( $cfg['conditions'] );
		$this->set_title( $cfg['title'] );
		$this->set_description( $cfg['description'] );
		$this->priority = $cfg['priority'];
	}

	/**
	 * Add link, used for example, documentation and how to resolve links
	 *
	 * @param $target
	 * @param $link
	 * @param bool $in_array
	 *  false for $target   = $link
	 *  true  for $target[] = $link
	 */
	protected function add_link( &$target, $link, $in_array = false ) {

		if( isset( $link['label'] ) && isset( $link['link'] ) ) {
			$add = array(
				'label' => $link['label'],
				'link' => $link['link']
			);
		} elseif( isset( $link['label'] ) && isset( $link['dialog'] ) ) {
			$add = array(
				'label'  => $link['label'],
				'dialog' => $link['dialog']
			);
		} elseif( count( $link, COUNT_RECURSIVE ) == 2 ) {
			$add = array(
				'label' => $link[0],
				'link' => $link[1]
			);
		}

		if( isset( $link['class'] ) )
			$add['class'] = $link['class'];

		if( isset( $add ) ) {
			if( $in_array ) {
				$target[] = $add;
			} else {
				$target = $add;
			}
		}

	}
}


text:
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2017.11.30 at 08:24:17 PM JST
//

package eu.datex2.schema._2_0rc1._2_0;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for ChangedFlagEnum.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="ChangedFlagEnum">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="catalogue"/>
 *     <enumeration value="filter"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "ChangedFlagEnum")
@XmlEnum
public enum ChangedFlagEnum {

    @XmlEnumValue("catalogue")
    CATALOGUE("catalogue"),
    @XmlEnumValue("filter")
    FILTER("filter");
    private final String value;

    ChangedFlagEnum(String v) {
        value = v;
    }

    public String value() {
        return value;
    }

    public static ChangedFlagEnum fromValue(String v) {
        for (ChangedFlagEnum c: ChangedFlagEnum.values()) {
            if (c.value.equals(v)) {
                return c;
            }
        }
        throw new IllegalArgumentException(v);
    }

}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.authorization.fluent.GroupsClient;
import com.azure.resourcemanager.authorization.fluent.models.CollectionOfDirectoryObject;
import com.azure.resourcemanager.authorization.fluent.models.CollectionOfDirectoryObject0;
import com.azure.resourcemanager.authorization.fluent.models.CollectionOfLinksOfDirectoryObject;
import com.azure.resourcemanager.authorization.fluent.models.GroupsOrderby;
import com.azure.resourcemanager.authorization.fluent.models.GroupsSelect;
import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphDirectoryObjectInner;
import com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in GroupsClient. */
public final class GroupsClientImpl implements GroupsClient {
    /** The proxy service used to perform REST calls. */
    private final GroupsService service;

    /** The service client containing this operation class. */
    private final MicrosoftGraphClientImpl client;

    /**
     * Initializes an instance of GroupsClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    GroupsClientImpl(MicrosoftGraphClientImpl client) {
        this.service = RestProxy.create(GroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for MicrosoftGraphClientGroups to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "MicrosoftGraphClient")
    public interface GroupsService {
        @Headers({"Content-Type: application/json"})
        @Get("/groups/{group-id}/acceptedSenders")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfDirectoryObject>> listAcceptedSenders(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @QueryParam("$top") Integer top,
            @QueryParam("$skip") Integer skip,
            @QueryParam("$search") String search,
            @QueryParam("$filter") String filter,
            @QueryParam("$count") Boolean count,
            @QueryParam("$orderby") String orderby,
            @QueryParam("$select") String select,
            @QueryParam("$expand") String expand,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post("/groups/{group-id}/acceptedSenders")
        @ExpectedResponses({201})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<MicrosoftGraphDirectoryObjectInner>> createAcceptedSenders(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @BodyParam("application/json") MicrosoftGraphDirectoryObjectInner body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("/groups/{group-id}/members")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfDirectoryObject0>> listMembers(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @QueryParam("$top") Integer top,
            @QueryParam("$skip") Integer skip,
            @QueryParam("$search") String search,
            @QueryParam("$filter") String filter,
            @QueryParam("$count") Boolean count,
            @QueryParam("$orderby") String orderby,
            @QueryParam("$select") String select,
            @QueryParam("$expand") String expand,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("/groups/{group-id}/members/$ref")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfLinksOfDirectoryObject>> listRefMembers(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @QueryParam("$top") Integer top,
            @QueryParam("$skip") Integer skip,
            @QueryParam("$search") String search,
            @QueryParam("$filter") String filter,
            @QueryParam("$count") Boolean count,
            @QueryParam("$orderby") String orderby,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Post("/groups/{group-id}/members/$ref")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<Void>> createRefMembers(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @BodyParam("application/json") Map<String, Object> body,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete("/groups/{group-id}/members/{directoryObject-id}/$ref")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<Void>> deleteRefMember(
            @HostParam("$host") String endpoint,
            @PathParam("group-id") String groupId,
            @PathParam("directoryObject-id") String directoryObjectId,
            @HeaderParam("If-Match") String ifMatch,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Accept: application/json", "Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfDirectoryObject>> listMore(
            @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);

        @Headers({"Accept: application/json", "Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfDirectoryObject0>> listMembersNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);

        @Headers({"Accept: application/json", "Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(OdataErrorMainException.class)
        Mono<Response<CollectionOfLinksOfDirectoryObject>> listRefMembersNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink, Context context);
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listAcceptedSendersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String selectConverted =
            (select == null)
                ? null
                : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String expandConverted =
            (expand == null)
                ? null
                : expand.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listAcceptedSenders(
                            this.client.getEndpoint(),
                            groupId,
                            top,
                            skip,
                            search,
                            filter,
                            count,
                            orderbyConverted,
                            selectConverted,
                            expandConverted,
                            accept,
                            context))
            .<PagedResponse<MicrosoftGraphDirectoryObjectInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listAcceptedSendersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String selectConverted =
            (select == null)
                ? null
                : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String expandConverted =
            (expand == null)
                ? null
                : expand.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        context = this.client.mergeContext(context);
        return service
            .listAcceptedSenders(
                this.client.getEndpoint(),
                groupId,
                top,
                skip,
                search,
                filter,
                count,
                orderbyConverted,
                selectConverted,
                expandConverted,
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<MicrosoftGraphDirectoryObjectInner> listAcceptedSendersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand) {
        return new PagedFlux<>(
            () ->
                listAcceptedSendersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, select, expand),
            nextLink -> listMoreSinglePageAsync(nextLink));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<MicrosoftGraphDirectoryObjectInner> listAcceptedSendersAsync(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        final List<GroupsSelect> select = null;
        final List<String> expand = null;
        return new PagedFlux<>(
            () ->
                listAcceptedSendersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, select, expand),
            nextLink -> listMoreSinglePageAsync(nextLink));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<MicrosoftGraphDirectoryObjectInner> listAcceptedSendersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        return new PagedFlux<>(
            () ->
                listAcceptedSendersSinglePageAsync(
                    groupId, top, skip, search, filter, count, orderby, select, expand, context),
            nextLink -> listMoreSinglePageAsync(nextLink, context));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<MicrosoftGraphDirectoryObjectInner> listAcceptedSenders(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        final List<GroupsSelect> select = null;
        final List<String> expand = null;
        return new PagedIterable<>(
            listAcceptedSendersAsync(groupId, top, skip, search, filter, count, orderby, select, expand));
    }

    /**
     * Get acceptedSenders from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return acceptedSenders from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<MicrosoftGraphDirectoryObjectInner> listAcceptedSenders(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        return new PagedIterable<>(
            listAcceptedSendersAsync(groupId, top, skip, search, filter, count, orderby, select, expand, context));
    }

    /**
     * Create new navigation property to acceptedSenders for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return directoryObject along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<MicrosoftGraphDirectoryObjectInner>> createAcceptedSendersWithResponseAsync(
        String groupId, MicrosoftGraphDirectoryObjectInner body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context -> service.createAcceptedSenders(this.client.getEndpoint(), groupId, body, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create new navigation property to acceptedSenders for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return directoryObject along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<MicrosoftGraphDirectoryObjectInner>> createAcceptedSendersWithResponseAsync(
        String groupId, MicrosoftGraphDirectoryObjectInner body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        } else {
            body.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createAcceptedSenders(this.client.getEndpoint(), groupId, body, accept, context);
    }

    /**
     * Create new navigation property to acceptedSenders for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return directoryObject on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<MicrosoftGraphDirectoryObjectInner> createAcceptedSendersAsync(
        String groupId, MicrosoftGraphDirectoryObjectInner body) {
        return createAcceptedSendersWithResponseAsync(groupId, body).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Create new navigation property to acceptedSenders for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return directoryObject along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<MicrosoftGraphDirectoryObjectInner> createAcceptedSendersWithResponse(
        String groupId, MicrosoftGraphDirectoryObjectInner body, Context context) {
        return createAcceptedSendersWithResponseAsync(groupId, body, context).block();
    }

    /**
     * Create new navigation property to acceptedSenders for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return directoryObject.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public MicrosoftGraphDirectoryObjectInner createAcceptedSenders(
        String groupId, MicrosoftGraphDirectoryObjectInner body) {
        return createAcceptedSendersWithResponse(groupId, body, Context.NONE).getValue();
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMembersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String selectConverted =
            (select == null)
                ? null
                : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String expandConverted =
            (expand == null)
                ? null
                : expand.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listMembers(
                            this.client.getEndpoint(),
                            groupId,
                            top,
                            skip,
                            search,
                            filter,
                            count,
                            orderbyConverted,
                            selectConverted,
                            expandConverted,
                            accept,
                            context))
            .<PagedResponse<MicrosoftGraphDirectoryObjectInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMembersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String selectConverted =
            (select == null)
                ? null
                : select.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        String expandConverted =
            (expand == null)
                ? null
                : expand.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        context = this.client.mergeContext(context);
        return service
            .listMembers(
                this.client.getEndpoint(),
                groupId,
                top,
                skip,
                search,
                filter,
                count,
                orderbyConverted,
                selectConverted,
                expandConverted,
                accept,
                context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<MicrosoftGraphDirectoryObjectInner> listMembersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand) {
        return new PagedFlux<>(
            () -> listMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, select, expand),
            nextLink -> listMembersNextSinglePageAsync(nextLink));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<MicrosoftGraphDirectoryObjectInner> listMembersAsync(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        final List<GroupsSelect> select = null;
        final List<String> expand = null;
        return new PagedFlux<>(
            () -> listMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, select, expand),
            nextLink -> listMembersNextSinglePageAsync(nextLink));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<MicrosoftGraphDirectoryObjectInner> listMembersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        return new PagedFlux<>(
            () ->
                listMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, select, expand, context),
            nextLink -> listMembersNextSinglePageAsync(nextLink, context));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<MicrosoftGraphDirectoryObjectInner> listMembers(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        final List<GroupsSelect> select = null;
        final List<String> expand = null;
        return new PagedIterable<>(
            listMembersAsync(groupId, top, skip, search, filter, count, orderby, select, expand));
    }

    /**
     * Get members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param select Select properties to be returned.
     * @param expand Expand related entities.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return members from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<MicrosoftGraphDirectoryObjectInner> listMembers(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        List<GroupsSelect> select,
        List<String> expand,
        Context context) {
        return new PagedIterable<>(
            listMembersAsync(groupId, top, skip, search, filter, count, orderby, select, expand, context));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<String>> listRefMembersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        return FluxUtil
            .withContext(
                context ->
                    service
                        .listRefMembers(
                            this.client.getEndpoint(),
                            groupId,
                            top,
                            skip,
                            search,
                            filter,
                            count,
                            orderbyConverted,
                            accept,
                            context))
            .<PagedResponse<String>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<String>> listRefMembersSinglePageAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        final String accept = "application/json";
        String orderbyConverted =
            (orderby == null)
                ? null
                : orderby.stream().map(value -> Objects.toString(value, "")).collect(Collectors.joining(","));
        context = this.client.mergeContext(context);
        return service
            .listRefMembers(
                this.client.getEndpoint(), groupId, top, skip, search, filter, count, orderbyConverted, accept, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<String> listRefMembersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby) {
        return new PagedFlux<>(
            () -> listRefMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby),
            nextLink -> listRefMembersNextSinglePageAsync(nextLink));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<String> listRefMembersAsync(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        return new PagedFlux<>(
            () -> listRefMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby),
            nextLink -> listRefMembersNextSinglePageAsync(nextLink));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    private PagedFlux<String> listRefMembersAsync(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        Context context) {
        return new PagedFlux<>(
            () -> listRefMembersSinglePageAsync(groupId, top, skip, search, filter, count, orderby, context),
            nextLink -> listRefMembersNextSinglePageAsync(nextLink, context));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<String> listRefMembers(String groupId) {
        final Integer top = null;
        final Integer skip = null;
        final String search = null;
        final String filter = null;
        final Boolean count = null;
        final List<GroupsOrderby> orderby = null;
        return new PagedIterable<>(listRefMembersAsync(groupId, top, skip, search, filter, count, orderby));
    }

    /**
     * Get ref of members from groups.
     *
     * @param groupId key: id of group.
     * @param top Show only the first n items.
     * @param skip Skip the first n items.
     * @param search Search items by search phrases.
     * @param filter Filter items by property values.
     * @param count Include count of items.
     * @param orderby Order items by property values.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return ref of members from groups as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedIterable<String> listRefMembers(
        String groupId,
        Integer top,
        Integer skip,
        String search,
        String filter,
        Boolean count,
        List<GroupsOrderby> orderby,
        Context context) {
        return new PagedIterable<>(listRefMembersAsync(groupId, top, skip, search, filter, count, orderby, context));
    }

    /**
     * Create new navigation property ref to members for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property ref value.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> createRefMembersWithResponseAsync(String groupId, Map<String, Object> body) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(context -> service.createRefMembers(this.client.getEndpoint(), groupId, body, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Create new navigation property ref to members for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property ref value.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Void>> createRefMembersWithResponseAsync(
        String groupId, Map<String, Object> body, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (body == null) {
            return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.createRefMembers(this.client.getEndpoint(), groupId, body, accept, context);
    }

    /**
     * Create new navigation property ref to members for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property ref value.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> createRefMembersAsync(String groupId, Map<String, Object> body) {
        return createRefMembersWithResponseAsync(groupId, body).flatMap(ignored -> Mono.empty());
    }

    /**
     * Create new navigation property ref to members for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property ref value.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> createRefMembersWithResponse(String groupId, Map<String, Object> body, Context context) {
        return createRefMembersWithResponseAsync(groupId, body, context).block();
    }

    /**
     * Create new navigation property ref to members for groups.
     *
     * @param groupId key: id of group.
     * @param body New navigation property ref value.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void createRefMembers(String groupId, Map<String, Object> body) {
        createRefMembersWithResponse(groupId, body, Context.NONE);
    }

    /**
     * Delete ref of member from groups.
     *
     * @param groupId key: id of group.
     * @param directoryObjectId key: directoryObject-id.
     * @param ifMatch ETag.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> deleteRefMemberWithResponseAsync(
        String groupId, String directoryObjectId, String ifMatch) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (directoryObjectId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter directoryObjectId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .deleteRefMember(
                            this.client.getEndpoint(), groupId, directoryObjectId, ifMatch, accept, context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete ref of member from groups.
     *
     * @param groupId key: id of group.
     * @param directoryObjectId key: directoryObject-id.
     * @param ifMatch ETag.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<Void>> deleteRefMemberWithResponseAsync(
        String groupId, String directoryObjectId, String ifMatch, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (groupId == null) {
            return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
        }
        if (directoryObjectId == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter directoryObjectId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service.deleteRefMember(this.client.getEndpoint(), groupId, directoryObjectId, ifMatch, accept, context);
    }

    /**
     * Delete ref of member from groups.
     *
     * @param groupId key: id of group.
     * @param directoryObjectId key: directoryObject-id.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> deleteRefMemberAsync(String groupId, String directoryObjectId) {
        final String ifMatch = null;
        return deleteRefMemberWithResponseAsync(groupId, directoryObjectId, ifMatch).flatMap(ignored -> Mono.empty());
    }

    /**
     * Delete ref of member from groups.
     *
     * @param groupId key: id of group.
     * @param directoryObjectId key: directoryObject-id.
     * @param ifMatch ETag.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> deleteRefMemberWithResponse(
        String groupId, String directoryObjectId, String ifMatch, Context context) {
        return deleteRefMemberWithResponseAsync(groupId, directoryObjectId, ifMatch, context).block();
    }

    /**
     * Delete ref of member from groups.
     *
     * @param groupId key: id of group.
     * @param directoryObjectId key: directoryObject-id.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void deleteRefMember(String groupId, String directoryObjectId) {
        final String ifMatch = null;
        deleteRefMemberWithResponse(groupId, directoryObjectId, ifMatch, Context.NONE);
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of directoryObject along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMoreSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        return FluxUtil
            .withContext(context -> service.listMore(nextLink, context))
            .<PagedResponse<MicrosoftGraphDirectoryObjectInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of directoryObject along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMoreSinglePageAsync(
        String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        context = this.client.mergeContext(context);
        return service
            .listMore(nextLink, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of directoryObject along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMembersNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        return FluxUtil
            .withContext(context -> service.listMembersNext(nextLink, context))
            .<PagedResponse<MicrosoftGraphDirectoryObjectInner>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of directoryObject along with {@link PagedResponse} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<MicrosoftGraphDirectoryObjectInner>> listMembersNextSinglePageAsync(
        String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        context = this.client.mergeContext(context);
        return service
            .listMembersNext(nextLink, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of links of directoryObject along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<String>> listRefMembersNextSinglePageAsync(String nextLink) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        return FluxUtil
            .withContext(context -> service.listRefMembersNext(nextLink, context))
            .<PagedResponse<String>>map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The URL to get the next list of items
     *     <p>The nextLink parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws OdataErrorMainException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return collection of links of directoryObject along with {@link PagedResponse} on successful completion of
     *     {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<PagedResponse<String>> listRefMembersNextSinglePageAsync(String nextLink, Context context) {
        if (nextLink == null) {
            return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
        }
        context = this.client.mergeContext(context);
        return service
            .listRefMembersNext(nextLink, context)
            .map(
                res ->
                    new PagedResponseBase<>(
                        res.getRequest(),
                        res.getStatusCode(),
                        res.getHeaders(),
                        res.getValue().value(),
                        res.getValue().odataNextLink(),
                        null));
    }
}


text:
package org.qi4j.tutorials.composites.tutorial7;

// START SNIPPET: solution

/**
 * This interface contains only the behaviour
 * of the HelloWorld object.
 */
public interface HelloWorldBehaviour
{
    String say();
}
// END SNIPPET: solution


text:
<?php

namespace tests\TomPHP\Transform;

use PHPUnit_Framework_TestCase;
use function TomPHP\Transform\__;
use TomPHP\Transform\Exception\MethodNotImplementedException;

final class BuildTest extends PHPUnit_Framework_TestCase
{
    /** @var BuilderExample */
    private $example;

    protected function setUp()
    {
        $this->example = new BuilderExample();
    }

    /** @test */
    public function it_builds_a_single_callMethod_transformation()
    {
        $fn = __()->getValue();

        $this->assertSame('method \'getValue\' level1', $fn($this->example));
    }

    /** @test */
    public function it_builds_a_single_callMethod_transformation_with_arguments()
    {
        $fn = __()->getArgument('test argument');

        $this->assertSame('test argument', $fn($this->example));
    }

    /** @test */
    public function it_builds_a_multiple_callMethod_transformation()
    {
        $fn = __()->getChild()->getValue();

        $this->assertSame('method \'getValue\' level2', $fn($this->example));
    }

    /** @test */
    public function it_returns_a_unique_builder_at_each_callMethod_step()
    {
        $step1 = __()->getChild();
        $step2 = $step1->getValue();

        $this->assertNotSame($step1($this->example), $step2($this->example));
    }

    /** @test */
    public function it_builds_a_getProperty_transformation()
    {
        $fn = __()->property;

        $this->assertSame('property \'property\' level1', $fn($this->example));
    }

    /** @test */
    public function it_builds_multiple_level_getProperty_transformation()
    {
        $fn = __()->child->property;

        $this->assertSame('property \'property\' level2', $fn($this->example));
    }

    /** @test */
    public function it_returns_a_unique_builder_at_each_getProperty_step()
    {
        $step1 = __()->child;
        $step2 = $step1->property;

        $this->assertNotSame($step1($this->example), $step2($this->example));
    }

    /** @test */
    public function it_builds_a_getElement_transformation()
    {
        $fn = __()['key'];

        $this->assertSame('value', $fn(['key' => 'value']));
    }

    /** @test */
    public function it_builds_multiple_level_getElement_transformation()
    {
        $fn = __()['user']['name'];

        $this->assertSame('Tom', $fn(['user' => ['name' => 'Tom']]));
    }

    /** @test */
    public function it_returns_a_unique_builder_at_each_getElement_step()
    {
        $step1 = __()['user'];
        $step2 = $step1['name'];

        $example = ['user' => ['name' => 'Tom']];

        $this->assertNotSame($step1($example), $step2($example));
    }

    /** @test */
    public function it_throws_MethodNotImplemented_exception_for_offsetExists()
    {
        $this->setExpectedException(MethodNotImplementedException::class);

        __()->offsetExists(1);
    }

    /** @test */
    public function it_throws_MethodNotImplemented_exception_for_offsetSet()
    {
        $this->setExpectedException(MethodNotImplementedException::class);

        __()->offsetSet(1, 'value');
    }

    /** @test */
    public function it_throws_MethodNotImplemented_exception_for_offsetUnset()
    {
        $this->setExpectedException(MethodNotImplementedException::class);

        __()->offsetUnset(1);
    }
}

final class BuilderExample
{
    /** @var int */
    private $level;

    public function __construct($level = 1)
    {
        $this->level = $level;
    }

    /**
     * @param string $name
     *
     * @return string
     */
    public function __get($name)
    {
        if ($name === 'child') {
            return new self($this->level + 1);
        }

        return "property '$name' level{$this->level}";
    }

    /**
     * @return string
     */
    public function getValue()
    {
        return "method 'getValue' level{$this->level}";
    }

    /**
     * @return self
     */
    public function getChild()
    {
        return new self($this->level + 1);
    }

    /**
     * @param mixed $argument
     *
     * @return mixed
     */
    public function getArgument($argument)
    {
        return $argument;
    }
}


text:
package org.apache.geronimo.st.ui.commands;

import java.util.ArrayList;
import java.util.List;
import org.apache.geronimo.st.core.GeronimoServerDelegate;
import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.wst.server.core.IServerWorkingCopy;

/**
 * @version $Rev$ $Date$
 */
public class SetClasspathContainersCommand extends ServerCommand {

    private List<String> newList;
    private List<String> oldList;

    /*
     * @param server
     * @param checkList string array
     */
    public SetClasspathContainersCommand(IServerWorkingCopy server, Object[] checkList) {

        super(server, "SetClasspathContainersCommand");
        this.newList = createList( checkList );

        Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand", checkList, checkList.length );
        Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand");
    }

    /*
     * (non-Javadoc)
     *
     * @see org.apache.geronimo.st.ui.commands.ServerCommand#execute()
     */
    public void execute() {
        Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.execute");

        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
        oldList = gs.getClasspathContainers();
        gs.setClasspathContainers(newList);

        Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.execute");
    }

    /*
     * (non-Javadoc)
     *
     * @see org.apache.geronimo.st.ui.commands.ServerCommand#undo()
     */
    public void undo() {
        Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.undo");

        GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
        gs.setClasspathContainers(oldList);

        Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.undo");
    }

    //
    // Convert object array to List<String>
    //
	public List<String> createList( Object[] checkList ) {
        Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.createList");

        List<String> containers = new ArrayList<String>();
        for (Object container : checkList) {
            containers.add( (String)container );
        }

        Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.createList", containers );
        return containers;
   }

}